Hi,
Here's the source code. I'm dealing with about 2000 records.But most of slow page occur when you bring back about 200 or more results.
Thanks
Sue
<?php
include("connectdb.php");
$sql="SELECT Category_Section,CategoryID,Category FROM categories WHERE Category_Section = '$Category_Section' order by Category ";
$results = mysql_query($sql);
$mycount = 0;
while ($myrow = mysql_fetch_array($results)) {
$newID = $myrow['CategoryID'];
$newSection = $myrow['Category_Section'];
$query = "SELECT CompanyID FROM companies_to_categories where CategoryID = $newID and Category_Section = '$newSection'";
$newresult = mysql_query($query);
$myrow1 = mysql_fetch_array($newresult);
$num = mysql_num_rows($newresult);
echo ("category[" . $mycount . "] = new categories(\"" . $myrow["Category"] . "\",'" . $myrow["CategoryID"] . "','" . $myrow["Category_Section"] . "','" . $num . "')" . "\n");
$mycount++;
}
?>