MySQL Forums
Forum List  »  MySQL Query Browser

PHP throwing mysql query error for query that runs correctly in client
Posted by: Esther Strom
Date: August 29, 2017 11:02AM

I have some PHP that generates a query. I'm error logging out the final query, and if I copy it out of the error log and run it directly in HeidiSQL, it runs with no problem. But when I try to run if via a PHP database call (which works in other sections with other queries), I'm getting an error. Any ideas?

Here's the generated query:

update exp_qo5_configs set value = '1' where name = 'homepage_heroes_num'; update exp_qo5_configs set value = '4' where name = 'homepage_deals_num'; update exp_qo5_configs set value = '1' where name = 'homepage_wide_banner_num'; update exp_qo5_configs set value = '2' where name = 'homepage_narrow_banner_num'; update exp_qo5_configs set value = '6' where name = 'homepage_menu_num';

And here's the error:
["Error Number: 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 'update exp_qo5_configs set value = '4' where name = 'homepage_deals_num'; update' at line 1","SQLQUERY: update exp_qo5_configs set value = '1' where name = 'homepage_heroes_num'; update exp_qo5_configs set value = '4' where name = 'homepage_deals_num'; update exp_qo5_configs set value = '1' where name = 'homepage_wide_banner_num'; update exp_qo5_configs set value = '2' where name = 'homepage_narrow_banner_num'; update exp_qo5_configs set value = '6' where name = 'homepage_menu_num'; ]

Any ideas?

Options: ReplyQuote


Subject
Written By
Posted
PHP throwing mysql query error for query that runs correctly in client
August 29, 2017 11:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.