Error only when I use PHP
Posted: Wed May 21, 2008 8:20 am
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
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