I have a php page generating an SQL query to update records. The test I am using looks like this:
UPDATE main SET obvemission = 0, obvcut = 0 WHERE coinid = 190 LIMIT 1; UPDATE main SET obvemission = 0, obvcut = 0 WHERE coinid = 185 LIMIT 1; UPDATE main SET obvemission = 3, obvcut = 0 WHERE coinid = 144 LIMIT 1; UPDATE main SET obvemission = 1, obvcut = 0 WHERE coinid = 94 LIMIT 1; UPDATE main SET obvemission = 2, obvcut = 0 WHERE coinid = 89 LIMIT 1; UPDATE main SET obvemission = 2, obvcut = 0 WHERE coinid = 3 LIMIT 1;
If I take it from the webpage and paste it into PHPmyadmin it works fine, but if I try to execute the query in the php page I get an error with a please check the manual for correct syntax to use near and the second of the update queries. It is the first time I have encountered this issue with identical strings working fine when manually entered but failing if they are executed through PHP. Has anyone got any ideas why this might be happening?
Robert
Error only when I use PHP
Moderator: General Moderators
Re: Error only when I use PHP
mysql_query() sends an unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier .
There are 10 types of people in this world, those who understand binary and those who don't
Re: Error only when I use PHP
Ah, that explains it, thanks for the help.
Robert
Robert