Re: PHP multiple SQL statements
As far as I'm aware, in php you can only do one statement per call. Terry --Original Message- > Hi there, > > When i try to do the following in PHP I get errors. Is this not > permitted or is this due to a setting somewhere? Can i do only one SQL > statement per call to mysql_query? > > $sql = "CREATE TEMPORARY TABLE tmp > SELECT field1_index, field2_index FROM test_table WHERE field1_index = > '1'; > INSERT INTO tmp > SELECT field1_index, field2_index FROM test_table WHERE field2_index = > '1'; > SELECT * from tmp; > DROP TABLE tmp;"; > > $res = mysql_query($sql); > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: PHP multiple SQL statements
"Edison Cneeden" <[EMAIL PROTECTED]> wrote: > Hi there, > > When i try to do the following in PHP I get errors. Is this not permitted or > is this due to a setting somewhere? Can i do only one SQL statement per call > to mysql_query? Yes. > > $sql = "CREATE TEMPORARY TABLE tmp > SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1'; > INSERT INTO tmp > SELECT field1_index, field2_index FROM test_table WHERE field2_index = '1'; > SELECT * from tmp; > DROP TABLE tmp;"; > > $res = mysql_query($sql); > > _ > > > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
PHP multiple SQL statements
Hi there, When i try to do the following in PHP I get errors. Is this not permitted or is this due to a setting somewhere? Can i do only one SQL statement per call to mysql_query? $sql = "CREATE TEMPORARY TABLE tmp SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1'; INSERT INTO tmp SELECT field1_index, field2_index FROM test_table WHERE field2_index = '1'; SELECT * from tmp; DROP TABLE tmp;"; $res = mysql_query($sql); _ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]