Page 1 of 1

what happen to my GOOGLE CHECKOUT ?

Posted: Thu Aug 12, 2010 6:16 am
by co2fish
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?

Re: what happen to my GOOGLE CHECKOUT ?

Posted: Thu Aug 12, 2010 5:56 pm
by JNeuhoff
Have you created the 2 database tables 'google_download' and 'google_order' as per the install.txt instructions?

Re: what happen to my GOOGLE CHECKOUT ?

Posted: Thu Aug 12, 2010 7:38 pm
by Qphoria
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