I'm running an app which controls newspaper delivery. A customer screen has four select boxes for each day of the week and each list is pulled from a mysql database. All the Monday to Friday boxes are the same.
The problem is that the lists are pretty long and loading all the boxes takes too much time. This is the code I'm using to populate each box, which is run as an include:
Can anyone suggest a way to make this more efficient and speed up the loading?<?php
$result = mysql_query("SELECT * FROM papers WHERE type='daily' ORDER BY paper",$db);
if ($myrow = mysql_fetch_array($result)) {
do {
$paper = $myrow["paper"];
$option="<option>";
printf("$option$paper<br>");
} while ($myrow = mysql_fetch_array($result));
} else {
echo "Sorry, no records were found!";
}
?>
Cheers,
Paul.