I want to take these results and display them by category. I.e. each of these results would fall into different categories like "insurance", they are maked in the database simply with a "Y" for each category that they would appear in. I could make a page like this for each of the 20 categories, but I am sure there is a better way. Just not sure what it is. I am still very new at this. Any direction you can give would be appreciated.
<?
if(!IsSet($start))
$start = 0;
$result = mysql_query("SELECT site_name, site_address, site_image, publish FROM sites WHERE publish = 'Y' ORDER BY site_name ASC LIMIT $start,144") or die(mysql_error());
?>
<table width="100%" border="0" cellspacing="4" cellpadding="4" align="center">
<tr>
<?
while($row = mysql_fetch_object($result))
{
echo '<td width="25%" align="center" valign="top"><a href= "',$row->site_address,'" target="blank"><img src="samples/',$row->site_image,'"width="100" height="75" border="0"></a><br><a href= "',$row->site_address,'" target="blank">',$row->site_name,'</a></td>';
if(++$i % 4 == 0)
echo '</tr><tr>';
}
?>
</table>