Hi R Sapers 🙂
I don't know why you're making an option list with 9000 people, but here's what I see.
The recordset you're returning is 9000 rows. You're creating a variable option_block that is created with 18000 array reads (2 columns * 9000 rows) 9000 string interpolations, 54000 (5 concatenations from interpolating and one concatenation to the option_block string) and 18000 resets of temporary variables (2 acct_id nad acct_uname).
In addition, there is no need to create the large variable option_block variable, just to spit it out later. In fact, you throw the whole 9000 options into another slightly larger variable display_block.
I would lose the display_block variable.
I would replace the $option_block variable in the form with a php code block that:
1] echoes output directly to client
2] doesn't use temporary vars
3] doesn't use option_block var.
4] uses single quote strings.
an example (you'll have to check for errors but you get the idea). I think you'll find the solution below is much faster than the other way.
Take care.
Mekka
<?
//database code to get recordset
?>
<FORM METHOD=\"post\" ACTION=\"delcust2.php\">
<P><strong>Customer:</strong>
<select name=\"acct_id\">
<?
while ($row = mysql_fetch_array($result)) {
echo ('<option value="'
.$row['acct_id']
.'"'
.$row['acct_uname']
.'</option>');
}
?>
</select>
<INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this Customer\"></P>
</form>