You guys have been awesome.
My script goes and selects ALL 8500 customers from MYSQL, which in MySQL workbench, takes about 0.16 seconds, which is fine, but it takes the browser 10 seconds to render the box from the results.
Is there a faster way to create this huge select box?
I'm stumped because I thought all the PHP was made on the server side and cannot be sped up.
<body>
<select name="customer" id="customer" onChange="getcustinfo();" data-placeholder="Choose a Customer" class="chosen-select" style="width:500px;" tabindex="1">
<option value=""></option>
<?php // get the products
$sql = "
SELECT *
FROM `cust`
LEFT Join `address`
ON `cust`.`custid` = `address`.`addcustid`
and `address`.`addtype` = 'b'
WHERE `cust`.`custactive` = 'y'"
;
$result = mysqli_query($con,$sql) or die('Query failed: Could not get list of CLIENTS: ' . mysqli_error($con)); // query
while ($row = mysqli_fetch_array($result)) {
foreach ($row as $key => $value){ ${$key} = $value; }
$space="";
$endingspaces = 4-(2*strlen($prodid));
$custname = substr($row['custname'],0,15);
$address1 = substr($row['address1'],0,15);
$addcity = substr($row['addcity'],0,15);
print "<option value=\"$custid\">$custid: $space$custname, $address1, $addcity, $addstate</option>";
}
?>
</select>
</body>