View Single Post
Old 02-18-2007, 03:38 AM  
tical
Confirmed User
 
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
Quote:
Originally Posted by darksoul View Post
the problem is mysql commits after each insert so you're better running a combined insert:

Code:
$dbcnx = mysql_connect('localhost','xxxxx', 'xxxxx'); 
mysql_select_db("testtable", $dbcnx); 
$cmd = "insert into users (muser) values ";
for ($i = 10000; $i <= 20000; $i++) { 
$cmd .= "($i),"
}
$cmd .= "(20001)"
mysql_query($cmd);
should be blazing fast.
blah crap i didnt even see this haha... ah well
__________________
112.020.756
tical is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote