View Single Post
Old 01-28-2008, 06:41 PM   #1 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,216
Thanks: 17
Village Idiot is on a distinguished road
Default Multiple mysql queries

Its been bugging me on how to do multiple mysql queries without a new mysql_query statement being called each time. This essentially calls a new one on every command, but its much cleaner

PHP Code:
$query "INSERT INTO `table` VALUES (bla,bla);
INSERT INTO `another_Table` VALUES (bla,bla);"
;

$arrexplode';'$query );
foreach( 
$arr as $command )
{
    
mysql_query$command );

As long as every command is separated with a semi-colon (which is required in regular mysql), it will execute them all.
Village Idiot is offline  
Reply With Quote