Performance related:
Is it better to make 1000 queries to insert 1000 rows:
for($i=1;$i<=1000;++$i){
$query = 'insert into table1 (First,Last) values ("Fred","Smith")';
mysql_query($query);
}
Or to create a query using PHP (by concatenating values in a for loop) like this:
$query = ' insert into table1 (First,Last) values ("Fred","Smith"),
("John","Smith"),
...
("Michael","Smith"),
("Robert","Smith")';
mysql_query($query);
Given that there may be lots of values I chose to insert 10 at a time. I don't know if that's ok, what's the best practice in this case?