Batch queries in the same mysql_query()

From: Date: Tue, 28 Jun 2005 04:20:55 +0000
Subject: Batch queries in the same mysql_query()
Groups: php.db 
Request: Send a blank email to php-db+get-39805@lists.php.net to get a copy of this message
Hi, I'm trying to execute multiple queries using mysql_query() function and I'm getting an error to check SQL syntax. My PHP code looks like: //------------------------- $sql="select x from y ; insert into y values ( 1, 2 )"; mysql_query( $sql ) or die( mysql_error() ); //------------------------- Maybe the problem resides on the character ";", but this queries run without problems when typed on "mysql" command-line tool. So, if it works on "mysql" command line, why it doesn't work using mysql_query() ? Any hint ? TIA, Denio Mariz

« previous php.db (#39805) next »