On Dec 13, 2007 10:37 AM, Daniel Brown <parasane@xxxxxxxxx> wrote: > <? > // Put DB and config includes here. > > $sql = "SELECT * FROM prod_table WHERE product_name != '' ORDER BY product_id"; > $result = mysql_query($sql) or die(mysql_error()); > while($row = mysql_fetch_array($result)) { > $ssql = "INSERT INTO tmp_table(product_id,product_name,val,val2) "; > $ssql .= "VALUES('".$row['product_id']."','".$row['product_name']."','$row['val']."','".$row['val2']."')"; > mysql_query($ssql); > } > > mysql_query("DROP TABLE prod_table"); > mysql_query("RENAME TABLE tmp_table TO prod_table") or die(mysql_error()); > ?> There are much prettier, cleaner, more efficient ways of doing it, I'm sure, but if you're banging your head off the wall just vying for a simple solution, MySQL can handle the ~5,001 queries without issue. ;-) -- Daniel P. Brown [Phone Numbers Go Here!] [They're Hidden From View!] If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php