Jump to content

What is wrong with this query ?


WarKirby

Recommended Posts

Having an error with an insert query. Maybe this should go in the mysql forum, not certain

$result = mysql_query("INSERT INTO ".$dbSalesTable." (customerKey,customerName,articleNumber,productName,pricePaid,timeSold,vendorRegion) VALUES(".$customerKey.",".$customerName.",".$row[articleNumber].",'".getProductName($row[contentArticle])."','0',".$timeSold.",".$vendorRegion.")") or die(mail($to, "Error inserting content", mysql_error()));

 

the mail call is me emailing myself the mysql error, since this script is being run by another. It gives me an error for this line which reads:

 

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 'Test Product,'0',1262328364,'Ferox')' at line 1

 

Test Product being the productname. It seems that the problem is around there.

Link to comment
https://forums.phpfreaks.com/topic/186836-what-is-wrong-with-this-query/
Share on other sites

$query= "INSERT INTO ".$dbSalesTable." (customerKey,customerName,articleNumber,productName,pricePaid,timeSold,vendorRegion) VALUES(".$customerKey.",".$customerName.",".$row[articleNumber].",'".getProductName($row[contentArticle])."','0',".$timeSold.",".$vendorRegion.");

 

$result = mysql_query($query,<database link>);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.