Forums / Cotonti / Support / shopsystem

Fatal error : SQL error

ruben
#1 2012-12-17 22:30

Hello,

i installed the shopsystem, but after installing and going to plug.php?e=shopsystem i get the following error:

Fatal error : SQL error : Table 'deb13042_main.sed_products_items' doesn't exist

can some1 help me with this?

lukgoh
#2 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)
ruben
#3 2012-12-18 08:39

Thank you for your fast reply! I will check this as soon as i'm home and let you know if it worked.

Added 8 hours later:

it works!

now i got another issue.

I would like this plugin to be the homepage. so no news etc, just this plugin. I'm busy trying to figure out how, but i'm not getting it right.

This post was edited by ruben (2012-12-18 16:50, 11 years ago)
lukgoh
#4 2012-12-18 16:53

The reason for your first issue is because 'prdct_url' column wasn't in that sql stuff in my earlier post so you need to create it yourself in phpmyadmin.

If you wanted to wait, I am writing a shop module. http://www.cotonti.com/forums?m=posts&q=7271&n=unread#unread

When it is released it will have all relevant tags for the index so you will be able to include them in your theme.

Luke.

Added 8 minutes later:

infact if you look in the comments: http://www.cotonti.com/145?dcm=2#c1013 I had the exact same problem like two years ago. 

This post was edited by lukgoh (2012-12-18 17:02, 11 years ago)
ruben
#5 2012-12-18 18:08

thank you for your reply.

i already fixed the first problem.

your shop module is looking good, i will definetly check it out when it's done!