I have a database with 40,000+ rows. I am trying to run a script for each row in the table as such:
$query = 'SELECT * FROM table';
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
//run PHP script here
}
The script may take about 10seconds to complete per row as there are some curl functions that take some time to load.
My question is how can I best run the script for every row in this table without it timing out or being slow in the browser? I would also like to run the script as a cron job but I'm not sure if this is possible? Quite new to all this, apologies if this seems trivial.