[Skip to main content](#vessel-content)

#   1064 SQL Syntax Error after saving a product

##

- **[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")**
- [![dancingkazzaf's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile") Topic Author
- [ Offline](/forum/user/31984-dancingkazzaf)

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 1 month ago [\#213482](#213482) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#213482 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")* was created by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")*

-- url of the page with the problem -- : [ 176.32.230.251/sewcharming.co.uk/](http://176.32.230.251/sewcharming.co.uk/)
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome 45.0.2454.85
-- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c_hikashop_product_category (category_id,product_id,ordering) VALUES (12,2,);

Hello, I have been trying to save a product but every time I do it creates this error:

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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c_hikashop_product_category (category_id,product_id,ordering) VALUES (12,2,);

I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.

Regards,
Karen

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 1 month ago [\#213487](#213487) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#213487 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi,

Change the line: Code:

$insert[]='('.$entry.','.$status.','.@$olds[$entry]-&gt;ordering.')';

to: Code:

$insert[]='('.$entry.','.$status.','.(int)@$olds[$entry]-&gt;ordering.')';

in the file administrator/components/com_hikashop/classes/product.php and that will fix the problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")**
- [![dancingkazzaf's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile") Topic Author
- [ Offline](/forum/user/31984-dancingkazzaf)

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 1 month ago [\#213491](#213491) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#213491 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Thank you that worked. What would cause this issue from a fresh install. Or is it an error in the code that needs to be corrected?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 1 month ago [\#213497](#213497) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#213497 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi,

Like explained in the previous message, It is a line in the code that need to be modified.
The package is already up-to-date for that fix.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago [\#228466](#228466) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228466 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

I am suffering the same with HikaShop 2.6.1, also looked for the code and is already the replacing one as suggested in your solution.

this is the fool message:
Code:

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 '' at line 1 SQL=INSERT IGNORE INTO s3ni1_hikashop_product_category (category_id,product_id,ordering) VALUES ;

working in local site at this moment so can't offer an acces.

any suggestion?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

10 years 8 months ago [\#228507](#228507) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228507 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi,

Well, it's not the same error so the fix will be different.

The error you have is really strange because it means that you're creating a product without any category, but normally in that case, the "product category" is added automatically to the product.
So I can only suppose that you deleted it or something ?

Try changing the line:
if(empty($element-&gt;categories) &amp;&amp; $element-&gt;product_type == 'main') {
to:
if((empty($element-&gt;categories) &#124;&#124; !count($element-&gt;categories) ) &amp;&amp; $element-&gt;product_type == 'main') {

in the file administrator/components/com_hikashop/classes/product.php and try again.

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago [\#228524](#228524) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228524 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Thanks Nicolas, I will try this later in the day and also put the experimental site online so I can give you access if we should explore further.

Thanks for the clear explanations and the code suggestion.

regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago [\#228682](#228682) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228682 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

I tried this code tweak with not full success, just half.

I applied the changes to both sites the one exporting CSV and the one importing CSV,

Since then the problem is not reproducing if the exported data is of an already existing product in the Target Site.

But if I create a new product in Site A, then export, then import in site B this message persists.
Code:

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 '' at line 1 SQL=INSERT IGNORE INTO s3ni1_hikashop_product_category (category_id,product_id,ordering) VALUES ;

This happens both for a NEW made product and for a NEW copied from an exiting one, without anything changed except for the 'copy_23764527" number that is automatically generated.

Both NEW and NEW copied products are made in HikaShop Backend.

---

Both sites are live if you would like to check, you have the access to them in your contact@ mailbox. They were sent today at 8:44 French time.

Access is in third page of PDF. That report is not directly related to this problem.

---

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

10 years 8 months ago [\#228769](#228769) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228769 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi,

So the issue is with your CSV.
What you're saving is a product entry where the "product_type" is neither "variant" nor "main" and that's not possible as these are the only two types that exists.
That's why you get the error.

I've added a patch on our end to avoid the error but that should normally not happen. I've updated the install packages on our end so you can download it again and install it again on your website and you'll get the patch to avoid that.

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago [\#228804](#228804) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228804 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Big thank you Nicolas for attending this. I will test this early tomorrow and report to you.

but what it goes beyond my understanding is why my product don't have a defined type (product or variant'. Where and when should this happen.

If I create products from the HikaShop backend shouldn't they get the type assigned?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago -  10 years 8 months ago [\#228809](#228809) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228809 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi Nicolas,

after your advise this is what i did:

Updated HikaShop to 2.6.1 latest version HikaShop Business 2.6.1 [1602031626] in both sites.

created a new product.
modified an existing product.

exported CSV. checked the CSV to make sure it contains the new product and the modified product. It does.

Imported with the mass action on my target site.

No error 1064 anymore. **But no new product imported.** modified product that was already existing in target site gets updated (changes were affecting product_name and product_code, so I understand the update has been made by matching the product_id).

Should some extra setting be defined to also accept new products?

Shouldn't the system update productsby matching product_code instead of product_id ? By now I am testing with cloned sites but in a real world I will update to sites where the same product only shares the product_code but not the product_id.

**UPDATE:**

Although probably not directly related later I installed the new massaction plugin released today by Xavier and replaced the classes/massaction.php file.

Tested with both modified products and new products again and the situation keeps exactly the same.

**SECOND UPDATE:**

I will be available most of the day for immediate testing any further code fix / improvement in the aim to make the import function add new products. I ignore if this situation is standard or specific to my sites. [strike]You have at your contact@ mailbox the access for both sites that was sent yesterday February 3rd at 8:44[/strike].

Thanks for the intensive implication you showed today in helping fixing these issues.

Last edit: 10 years 8 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile"). Reason: Striked unnecessary information I realized you are already aware

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

10 years 8 months ago -  10 years 8 months ago [\#228806](#228806) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228806 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi,

By creating a product in HikaShop (or HikaMarket), you will create a product with "main" product_type.

If you don't see the products after the import, check if you find them in the hikashop_product table and if you do check their product_type. It can only be main or variant. If it's something else, it won't be found by HikaShop.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 10 years 8 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile")
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 8 months ago -  10 years 8 months ago [\#228834](#228834) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[1064 SQL Syntax Error after saving a product](/forum/26-product-category-display/879131-1064-sql-syntax-error-after-saving-a-product#228834 "-- url of the page with the problem -- :   176.32.230.251/sewcharming.co.uk/  -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : Chrome 45.0.2454.85 -- Error-message(debug-mod must be tuned on) -- : 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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  Hello, I have been trying to save a product but every time I do it creates this error:  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 ')' at line 1 SQL=INSERT IGNORE INTO fpz1c&#95;hikashop&#95;product&#95;category (category&#95;id,product&#95;id,ordering) VALUES (12,2,);  I have only just installed Hikashop and I didn't get any errors upon installation. I created categories fine it was only when I began to create a product and save it the error displayed. I have tried a few times and still getting the same error.  Regards, Karen")*

Hi Jerome,

the 1064 error was over after last Nicolas patch he asked me to install. But now the problem is that the import Mass action only updates products already existing by product_id, but is ignoring the import of new products.

According to a Mass Action filter they are all of the kind "main".

[ ![Captura&#95;de&#95;pantalla&#95;2016-02-03&#95;a&#95;les&#95;23&#95;57&#95;57.png](/forum/attachment/29321) ](/forum/attachment/29321 "...s&#95;23&#95;57&#95;57.png")

and I checked that both the field definition "product_type" and its value "main" are showing in the exported CSV.

so this information may get lost in the Mass Action Import operation,

Can you help?

––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
**UPDATE:**
After further testing and experimenting I could reduce the bug location to the CSV import Mass Action method (but don't know how to fix it)

So i open a new fresh thread with only the really necessary information

[ www.hikashop.com/forum/content-creation/...-matched.html#228838](http://www.hikashop.com/forum/content-creation/882071-mass-actions-do-not-import-non-product-id-matched.html#228838)
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

- [ ![Captura&#95;de&#95;pantalla&#95;2016-02-03&#95;a&#95;les&#95;23&#95;57&#95;57.png](/forum/attachment/29321) ](/forum/attachment/29321 "...s&#95;23&#95;57&#95;57.png") [ ](/forum/attachment/29321?download=1 "...s&#95;23&#95;57&#95;57.png")

Last edit: 10 years 8 months ago by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxMzEtMTA2NC1zcWwtc3ludGF4LWVycm9yLWFmdGVyLXNhdmluZy1hLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.375 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
