Run PHP Script For Each MySQL Row -
i have database 40,000+ rows. trying run script each row in table such:
$query = 'select * table'; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { //run php script here } the script may take 10seconds complete per row there curl functions take time load.
my question how can best run script every row in table without timing out or being slow in browser? run script cron job i'm not sure if possible? quite new this, apologies if seems trivial.
you can set maximum exicution time script as
ini_set('max_execution_time', 'time in second');
it increase timeout of script , should use-
while ($row = mysql_fetch_array($result)) { } instead of while ($row = mysql_fetch_assoc($result)) { }
Comments
Post a Comment