View Single Post
Old 07-16-2009, 01:43 PM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Smile

You can loop to concatenate the query string and then query at the end, that way there is not a lot of sequential queries, but just one.
PHP Code:
$query 'INSERT INTO thetable(column1, column2, column3, column4) ';
//$assuming the data is comming from a db query.
while ($row mysql_fetch_assoc($rs)) {
    
$query .= 'VALUES('.$row['name'].', '.$row['city'].', '.$row['special_number'].', '.$row['code'].') ';
}
$result mysql_query($query) or die(mysql_error()); 
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
captainmerton (07-16-2009)