var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: need help with PHP/MySQL query syntax
Here's the line of code I'm having trouble with:
$update_data_query = "UPDATE prices SET (part_no=".$part_no_update.",part_description=".$p art_description_update.",price_1_9=".$price_1_9_up date.",price_10_24=".$price_10_24_update.",price_2 5_49=".$price_25_49_update.",price_50_99=".$price_ 50_99_update.",price_100=".$price_100_update." WHERE part_no=".$part_no.")";
The query works on the command line (with different syntax) and the variables contain values. I don't get a syntax error, the query simply won't run.
I would appreciate any advice or help that anyone has- thanks!
you are missing the quotes required for the SQL statement. You need to modify your code like this:
$update_data_query = "UPDATE prices SET (part_no='".$part_no_update."',part_description='".$part_description_update.'"
Last edited by gannet; 06-26-03 at 05:44.
Thanks for replying!
Not trying to anticipate you but I did what you're suggesting, as per my reference book, and that didn't work either.
I'll redo my code as per your suggestion and look again for any logical problems.
You could try displaying $update_data_query on your page to help look for errors. I often find this helpful especially with complex queries. That way you can also see the value of the variables.
If you're not getting a syntax error then be happy.
Directly after this line:
simply add this line to your code
where $link is the variable you used to establish the connection to your database.