Forums / Cotonti / Support / shopsystem

Fatal error : SQL error

lukgoh
#36562 2012-12-17 23:35

I think the problem is you have a different database prefix to the one setup for this plugin. The fix isn't going to be a quick one depending on how many requests this plugin makes to the database. 

In the plugins function page you need to add something like this:

$db_products_items = (isset($db_products_items)) ? $db_products_items : $db_x . 'products_items';

Then you need to go through the plugin and find any database interaction with that table (queries, inserts, updates or deletes) and change them from 'sed_products_items' to '$db_products_items' 

then you need to repeat this process for each table name used by the plugin. 

Of course the other issue might be the SQL install didn't work properly so that would mean that the table didn't exist. First check in phpmyadmin if you have access to it and check to make sure the plugin has installed its tables correctly. Then check to see if you are using a different prefix to the ones being installed by the plugin. I think the default for Siena is 'cot_' 

I hope this helps.

Luke.

Added 7 minutes later:

No you can ignor all that. I just downloaded the plugin to take a look for myself, the tables don't exist as the creator of that plugin didn't include the SQL installer folder.

You need to run this via phpmyadmin on your database:

CREATE TABLE `sed_products_itemcat` (
`prdct_catid` int(11) NOT NULL auto_increment,
`prdct_title` varchar(255) NOT NULL,
`prdct_desc` varchar(255) NOT NULL,
PRIMARY KEY (`prdct_catid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=71 ;

CREATE TABLE `sed_products_items` (
`prdct_id` int(11) unsigned NOT NULL auto_increment,
`prdct_state` tinyint(1) unsigned NOT NULL default '0',
`prdct_price` varchar(255) NOT NULL,
`prdct_amount` varchar(255) NOT NULL,
`prdct_extra1` varchar(255) NOT NULL,
`prdct_extra2` varchar(255) NOT NULL,
`prdct_extra3` varchar(255) NOT NULL default '',
`prdct_extra4` varchar(255) NOT NULL default '',
`prdct_extra5` varchar(255) NOT NULL default '',
`prdct_extra6` varchar(255) NOT NULL,
`prdct_extra7` varchar(255) NOT NULL,
`prdct_extra8` varchar(255) NOT NULL,
`prdct_extra9` varchar(255) NOT NULL,
`prdct_extra10` varchar(255) NOT NULL,
`prdct_title` varchar(255) default NULL,
`prdct_desc` varchar(255) default NULL,
`prdct_info` text,
`prdct_ownerid` int(11) NOT NULL default '0',
`prdct_date` int(11) NOT NULL default '0',
`prdct_update` int(11) NOT NULL,
`prdct_img` varchar(255) default NULL,
`prdct_cat` varchar(255) NOT NULL,
PRIMARY KEY (`prdct_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ;

CREATE TABLE `sed_products_sold` (
`id` int(11) NOT NULL,
`prdct_id` int(11) unsigned NOT NULL,
`prdct_state` tinyint(1) unsigned NOT NULL default '0',
`prdct_buyerid` tinyint(1) default '0',
`prdct_amount` varchar(255) NOT NULL,
`prdct_date` int(11) NOT NULL default '0',
PRIMARY KEY (`prdct_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Luke.

This post was edited by lukgoh (2012-12-17 23:42, 11 years ago)