SQL Error in Import
- brainforge
-
Topic Author
- Offline
Less
More
15 years 8 months ago #4336
by brainforge
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.
SQL Error in Import was created by brainforge
2 commas - '(38,,40,...)'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)
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.
15 years 8 months ago #4342
by nicolas
Replied by nicolas on topic Re: SQL Error in Import
You can replace the line :
by the line:
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...
Code:
$ids[]=$product->product_id;
Code:
$ids[]=(int)$product->product_id;
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.
- brainforge
-
Topic Author
- Offline
15 years 8 months ago #4346
by brainforge
Replied by brainforge on topic Re: SQL Error in Import
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.
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.
15 years 8 months ago #4351
by nicolas
Replied by nicolas on topic Re: SQL Error in Import
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"
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.173 seconds