seperated mysql statement query in php

Posted by stone on Stack Overflow See other posts from Stack Overflow or by stone
Published on 2010-05-19T15:45:03Z Indexed on 2010/05/19 18:00 UTC
Read the original article Hit count: 174

Filed under:
|

So, I can run the following statements from within mysql itself successfully.

SET @fname = 'point1';
SELECT * FROM country WHERE name=@fname;`

But when I try to pass the query through php like this and run it, I get an error on the second line

$query = "SET @fname = 'point1';";

$query  .=  "SELECT * FROM country WHERE name=@fname;";

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql-query