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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -