I have a mysql table (with 8,316 rows) I’m trying to output to an array in PHP, but it times out (at around 8,058 to 8,060 rows). Anyone know how to resolve this:
Here’s my environment:
PHP 5.3.3, Linux host, MySQL 5.1.61
Here’s my code:
mysql_select_db($database, $connection);
$query_rs_data = sprintf(" SELECT * FROM my_table ");
$rs_data = mysql_query($query_rs_data, $connection) or die(mysql_error());
$row_rs_data = mysql_fetch_assoc($rs_data);
$totalRows_rs_data = mysql_num_rows($rs_data);
echo $totalRows_rs_data;
$my_array = array();
$count = 0;
do {
$count = $count + 1;
echo $count . "<br/>";
$my_array[$row_rs_data['id']] = $row_rs_data;
} while ($row_rs_data = mysql_fetch_assoc($rs_data));