Page 1 of 1

Importing Products - Error No: 1064

Posted: Tue Jul 16, 2019 1:24 pm
by creativient
anyone could help me how to resolve the error below? I'm using the import/export to upload multiple products.

Error: 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 ''',1,0.00,0,NOW(),NOW(),NOW(),0,1,0,0,0,0,0,0,'1','0','1','1')' at line 1
Error No: 1064
INSERT INTO `ocbm_product` (`product_id`,`quantity`,`sku`,`upc`,`ean`,`jan`,`isbn`,`mpn`,`location`,`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`points`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,`tax_class_id`,`viewed`,`length`,`width`,`height`,`length_class_id`,`sort_order`,`subtract`,`minimum`) VALUES (17,1,'','','','','','','',0,'MOD-17',,'',1,0.00,0,NOW(),NOW(),NOW(),0,1,0,0,0,0,0,0,'1','0','1','1');

Re: Importing Products - Error No: 1064

Posted: Tue Jul 16, 2019 2:51 pm
by letxobnav
the value of manufacturer_id is not defined.

Re: Importing Products - Error No: 1064

Posted: Tue Jul 16, 2019 2:51 pm
by cedcommerceteam
Hi there,

This is a SQL syntax error for ', please write (int) for integer values and $this->db->escape() for string values.
For Example :

Code: Select all

$this->db->query("INSERT INTO `". DB_PREFIX ."table` SET `product_id` = '". (int) $product_id ."', `name` = '". $this->db->escape($name) ."' ");
Check for extra apostrophes.

Please try storing data by above way, if you have any queries do write us here.

https://cedcommerce.com/opencart-servic ... edium=post

Thanks & Regards :