I have a MySQL query which selects and then loops through all records (about 200 rows). There are 2 date cells for each row, which are displayed like this:
date('d/m/Y', strtotime($row['date_created']));
date('d/m/Y', strtotime($row['date_edited']));
The issue is that these two causes script to run for a long time and eventually time out. When checking the server log, I found these errors:
(70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed
ap_pass_brigade failed with error 70007: The timeout specified has expired
Both fields in db table are specified as datetime. Displaying them without date format modifications works well. What causes this issue and how to resolve it? Never experienced these issues with dates before.
Here is a simplified query:
$result = mysql_query("SELECT date_created, date_edited FROM news");
while($row = mysql_fetch_array($result)) {
//date lines above here
}
Without strtotime and date it prints out right away, no delay.