PHP multiple SQL statements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Edison Cneeden

    #1

    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($sq l);

    _______________ _______________ _______________ _______________ _____



    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...