Note that you can (and should) insert many values with every query. Something like:
$sql = "INSERT INTO table1 (Col1, Col2)
VALUES ('1,', '1'), ('2','1'), ('3','1'), ('4','1'), ('5','1'), ('6','1'), ('7','1'), ('8','1'), ('9','1'), ('10','1')";
mysql_query($sql);