Post by co2fish » Thu Aug 12, 2010 6:16 am

I uploaded all the files, then "installed" -> filled out google Merchant ID, and key and everything -> enable

when I went to the store front it appear errors below:

Error: Table 'mlavalco_0904.google_download' doesn't exist
Error No: 1146
DELETE FROM `google_download` WHERE `expire` < '1281564894'


could any one tell me what wrong?

Newbie

Posts

Joined
Sun Jul 05, 2009 4:09 am

Post by JNeuhoff » Thu Aug 12, 2010 5:56 pm

Have you created the 2 database tables 'google_download' and 'google_order' as per the install.txt instructions?
Last edited by JNeuhoff on Thu Aug 12, 2010 8:07 pm, edited 1 time in total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Thu Aug 12, 2010 7:38 pm

As I've already replied to your comment about install/uninstall function support in 1.4.9
another tip that might have helped you to date would be to call a dbinsert function from the admin index() function. I do this with many of my mods that require custom database fields

I add a function called "checkdb()" to the admin controller at the bottom and call
$this->checkdb(); on the first line in the index() function

checkdb is something like this:

Code: Select all

private function checkdb() {

		// create table 1. If not exists will prevent duplicate
		$sql = "
			CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "my_table_1` (
			  `test_id` int(11) NOT NULL,
			  `test_detail` int(11) NOT NULL,
			  PRIMARY KEY  (`test_id`)
			) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
		
		$this->db->query($sql);	
		
		// create table 2. If not exists will prevent duplicate
		$sql = "
			CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "my_table_2` (
			  `unit_id` int(11) NOT NULL,
			  `unit_detail` int(11) NOT NULL,
			  PRIMARY KEY  (`unit_id`)
			) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
		
		$this->db->query($sql);
}
There are also ways for checking if a column exists on an existing table and to add it if it doesn't exist. Makes things like this easier to manage. Granted a proper installer package would be ideal... but rome... day... etc

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 47 guests