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

#   SQL Error in Import

##

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 10 months ago [\#4336](#4336) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  *[SQL Error in Import](/forum/3-bug-report/4336-sql-error-in-import#4336 "2 commas - '(38,,40,...)'  Looks like a sanity check is needed when generating the SQL.  Will investigate my CSV file later to find out why this is happening - and if necessary produce a test case for you.")* was created by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")*

> JDatabaseMySQL::query: 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 '40,41,42,43,44,45,46,47,48)' at line 1 SQL=DELETE FROM saj\_hikashop\_price WHERE price\_product\_id IN (38,,40,41,42,43,44,45,46,47,48)

2 commas - '(38,,40,...)'

Looks like a sanity check is needed when generating the SQL.

Will investigate my CSV file later to find out why this is happening - and if necessary produce a test case for you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80MzM2LXNxbC1lcnJvci1pbi1pbXBvcnQ/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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 10 months ago [\#4342](#4342) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: SQL Error in Import](/forum/3-bug-report/4336-sql-error-in-import#4342 "2 commas - '(38,,40,...)'  Looks like a sanity check is needed when generating the SQL.  Will investigate my CSV file later to find out why this is happening - and if necessary produce a test case for you.")*

You can replace the line : Code:

$ids[]=$product-&gt;product_id;

by the line: Code:

$ids[]=(int)$product-&gt;product_id;

in the fil administrator/components/com_hikashop/helpers/import.php to fix the problem.
Now, that means that some data is not consistant for some reason so you might be missing some data somewhere...

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

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile") Topic Author
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 10 months ago [\#4346](#4346) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: SQL Error in Import](/forum/3-bug-report/4336-sql-error-in-import#4346 "2 commas - '(38,,40,...)'  Looks like a sanity check is needed when generating the SQL.  Will investigate my CSV file later to find out why this is happening - and if necessary produce a test case for you.")*

Looking at the table data saw where I needed to tidyup.

Problem caused by newlines in the CSV file product_description field.
Removed those then import worked OK.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80MzM2LXNxbC1lcnJvci1pbi1pbXBvcnQ/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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 10 months ago [\#4351](#4351) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: SQL Error in Import](/forum/3-bug-report/4336-sql-error-in-import#4351 "2 commas - '(38,,40,...)'  Looks like a sanity check is needed when generating the SQL.  Will investigate my CSV file later to find out why this is happening - and if necessary produce a test case for you.")*

It should work with new lines in the description as long as the field is double quoted :
product_code,product_description
test,"my desc
on several lines"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80MzM2LXNxbC1lcnJvci1pbi1pbXBvcnQ/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.051 seconds

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