arunpatal Posted December 1, 2012 Share Posted December 1, 2012 (edited) Hi, i am trying to install shopping cart script this is the sourse http://www.phpwebcommerce.com/ But i am facing problem while uploading sql file... (xampp) when i am trying to import plaincart.sql it show me error like this Error SQL query: CREATE TABLE `tbl_cart` ( `ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT , `pd_id` int( 10 ) unsigned NOT NULL default '0', `ct_qty` mediumint( 8 ) unsigned NOT NULL default '1', `ct_session_id` char( 32 ) NOT NULL default '', `ct_date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY ( `ct_id` ) , KEY `pd_id` ( `pd_id` ) , KEY `ct_session_id` ( `ct_session_id` ) ) TYPE = MYISAM AUTO_INCREMENT =58; MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM AUTO_INCREMENT=58' at line 10 Have anyone have idea what i am doing wrong? Edited December 1, 2012 by arunpatal Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/ Share on other sites More sharing options...
NomadicJosh Posted December 1, 2012 Share Posted December 1, 2012 Wha happens when you change this line TYPE = MYISAM AUTO_INCREMENT =58; to this: TYPE=MyISAM DEFAULT AUTO_INCREMENT=58; Notice how I spelled MyISAM. Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396767 Share on other sites More sharing options...
arunpatal Posted December 2, 2012 Author Share Posted December 2, 2012 Wha happens when you change this line TYPE = MYISAM AUTO_INCREMENT =58; to this: TYPE=MyISAM DEFAULT AUTO_INCREMENT=58; Notice how I spelled MyISAM. check the error... it is already spell like that MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM AUTO_INCREMENT=58' at line 10 Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396773 Share on other sites More sharing options...
Christian F. Posted December 2, 2012 Share Posted December 2, 2012 The problem is that the SQL is made for an old version of MySQL, which means that the TYPE parameter have been removed and replace with the "ENGINE" parameter instead. Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396776 Share on other sites More sharing options...
arunpatal Posted December 2, 2012 Author Share Posted December 2, 2012 The problem is that the SQL is made for an old version of MySQL, which means that the TYPE parameter have been removed and replace with the "ENGINE" parameter instead. so i changed TYPE to ENGINE now table look like this DROP TABLE IF EXISTS `tbl_cart`; CREATE TABLE `tbl_cart` ( `ct_id` int(10) unsigned NOT NULL auto_increment, `pd_id` int(10) unsigned NOT NULL default '0', `ct_qty` mediumint( unsigned NOT NULL default '1', `ct_session_id` char(32) NOT NULL default '', `ct_date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`ct_id`), KEY `pd_id` (`pd_id`), KEY `ct_session_id` (`ct_session_id`) ) ENGINE=MyISAM DEFAULT AUTO_INCREMENT=58; but i got new error now Error SQL query: CREATE TABLE `tbl_cart` ( `ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT , `pd_id` int( 10 ) unsigned NOT NULL default '0', `ct_qty` mediumint( 8 ) unsigned NOT NULL default '1', `ct_session_id` char( 32 ) NOT NULL default '', `ct_date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY ( `ct_id` ) , KEY `pd_id` ( `pd_id` ) , KEY `ct_session_id` ( `ct_session_id` ) ) ENGINE = MYISAM DEFAULT AUTO_INCREMENT =58; MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'auto_increment=58' at line 10 Now what is wrong?? Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396787 Share on other sites More sharing options...
Christian F. Posted December 2, 2012 Share Posted December 2, 2012 The script is too old, as mentioned before. I would recommend going with a newer software, which is capable of running on the server software you have. That way you avoid a lot of other potential headaches, many of which can be quite tricky to notice. Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396793 Share on other sites More sharing options...
arunpatal Posted December 2, 2012 Author Share Posted December 2, 2012 The script is too old, as mentioned before. I would recommend going with a newer software, which is capable of running on the server software you have. That way you avoid a lot of other potential headaches, many of which can be quite tricky to notice. You are right... can you suggest any good simple and free shopping cart script?? Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396795 Share on other sites More sharing options...
Christian F. Posted December 2, 2012 Share Posted December 2, 2012 OpenCart, Magento and there's a Wordpress plugin (don't remember its name). That's three alternatives to start with, at least. Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396801 Share on other sites More sharing options...
arunpatal Posted December 2, 2012 Author Share Posted December 2, 2012 OpenCart, Magento and there's a Wordpress plugin (don't remember its name). That's three alternatives to start with, at least. THANKS Quote Link to comment https://forums.phpfreaks.com/topic/271460-importing-sql-file/#findComment-1396831 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.