I was wondering if there was a way of get a distinct result when getting information out of a database for one field and not all fields?
this is what I am using at the moment:
<?php
include "connect.php";
$query = "SELECT DISTINCT type_id, type
FROM $dbtable[trailer]
ORDER BY type_id";
$result = mysql_query($query)
or die(mysql_errno().": ".mysql_error());
$content = "<br><b><u><center>SALES</center></u></b><br>";
while($row=mysql_fetch_array($result)) {
extract($row);
$content .= "<a href=\"browse2.php?type_id=$row[type_id]\">$row[type]</a><br/>";
}
?>
the field I need to be distinct is the type_id.
Any help would be greatly appreciated.