MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Edison Cneeden Date:July 11 2003 8:43am
Subject:PHP multiple SQL statements
View as plain text  
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);

_________________________________________________________________


Thread
PHP multiple SQL statementsEdison Cneeden11 Jul
  • Re: PHP multiple SQL statementsEgor Egorov11 Jul
  • Re: PHP multiple SQL statements(Terry Riley)11 Jul