krys Posted June 11, 2011 Share Posted June 11, 2011 Hi All Please forgive me is I'm new to this and learning slowly as I go.. I'm trying to install a code I downloaded from oscommerce and put into my site. I have followed the instructions but have come up with this error whilst trying to paste it into SQL in myPHPadmin #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 'CREATE TABLE `discount_codes` ( `discount_codes_id` int(11) NOT NULL auto_inc' at line 7 This is the query I was pasting: CREATE TABLE `customers_to_discount_codes` ( `customers_id` int(11) NOT NULL default '0', `discount_codes_id` int(11) NOT NULL default '0', KEY `customers_id` (`customers_id`), KEY `discount_codes_id` (`discount_codes_id`) ) CREATE TABLE `discount_codes` ( `discount_codes_id` int(11) NOT NULL auto_increment, `products_id` text, `categories_id` text, `manufacturers_id` text, `excluded_products_id` text, `customers_id` text, `orders_total` tinyint(1) NOT NULL default '0', `order_info` tinyint(1) NOT NULL default '0', `discount_codes` varchar( NOT NULL default '', `discount_values` varchar( NOT NULL default '', `minimum_order_amount` decimal(15,4) NOT NULL default '0.0000', `expires_date` date NOT NULL default '0000-00-00', `number_of_orders` int(4) NOT NULL default '0', `number_of_use` int(4) NOT NULL default '0', `number_of_products` int(4) NOT NULL default '0', `status` tinyint(1) NOT NULL default '1', PRIMARY KEY (`discount_codes_id`) ) I feel I've googled all the help I can get but not getting anywhere! Is anyone able to assist me? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/ Share on other sites More sharing options...
trq Posted June 11, 2011 Share Posted June 11, 2011 Your missing the closing ; around your first query. eg; this CREATE TABLE `customers_to_discount_codes` ( `customers_id` int(11) NOT NULL default '0', `discount_codes_id` int(11) NOT NULL default '0', KEY `customers_id` (`customers_id`), KEY `discount_codes_id` (`discount_codes_id`) ) should be... CREATE TABLE `customers_to_discount_codes` ( `customers_id` int(11) NOT NULL default '0', `discount_codes_id` int(11) NOT NULL default '0', KEY `customers_id` (`customers_id`), KEY `discount_codes_id` (`discount_codes_id`) ); Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228247 Share on other sites More sharing options...
krys Posted June 11, 2011 Author Share Posted June 11, 2011 oh my god thank you so much! Feel like a right idiot right now...! Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228248 Share on other sites More sharing options...
krys Posted June 11, 2011 Author Share Posted June 11, 2011 And just to be a pain... do you know what this means when its says copy the files to the oscommerce shop? 2. Copy the new files from the catalog/ folder to your osCommerce shop: catalog/includes/modules/order_total/ot_discount.php catalog/includes/languages/english/modules/order_total/ot_discount.php catalog/admin/discount_codes.php catalog/admin/includes/languages/english/discount_codes.php catalog/admin/includes/languages/english/images/buttons/button_new_discount_code.gif Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228249 Share on other sites More sharing options...
trq Posted June 12, 2011 Share Posted June 12, 2011 What do you think it means? Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228544 Share on other sites More sharing options...
krys Posted June 12, 2011 Author Share Posted June 12, 2011 It clicked right after I sent that! Have gotten it all done but now as trying to install the module I get this error message.. Fatal error: Cannot redeclare class ot_discount in /home/flishclo/public_html/includes/modules/order_total/ot_discount.php on line 16 Any ideas? Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228545 Share on other sites More sharing options...
trq Posted June 12, 2011 Share Posted June 12, 2011 I would say it's just crap code. The ot_discount class is being included more than once. Further questions would belong in the Third Party Scripts board. Link to comment https://forums.phpfreaks.com/topic/239043-installing-discount-code-into-oscommerce-site-syntax-error/#findComment-1228547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.