SQL Error in Import

  • Posts: 291
  • Thank you received: 4
  • Hikashop Business
13 years 2 months ago #4336

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 or Create an account to join the conversation.

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
13 years 2 months ago #4342

You can replace the line :

$ids[]=$product->product_id;
by the line:
$ids[]=(int)$product->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 or Create an account to join the conversation.

  • Posts: 291
  • Thank you received: 4
  • Hikashop Business
13 years 2 months ago #4346

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 or Create an account to join the conversation.

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
13 years 2 months ago #4351

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 or Create an account to join the conversation.

Time to create page: 0.361 seconds
Powered by Kunena Forum