|
$query = "SELECT name, vehicle from TABLE ORDER BY name"; Not sure if that is correct SQL but it's something like that.
[PHP]while ($line = mysql_fetch_row($result) )
{
if(isset($prevName))
{
if($prevName == $line[0])
{
echo = " | " . $line[1];
}
else
{
echo = "<br />" $line[0] . ":" . $line[1];
}//endif
}
else
{
echo = "<br />" $line[0] . ":" . $line[1];
}//endif
$prevName = $line[0];
}//endwhile[/PHP]
I think that should do what your looking for. If it gives you errors tell me. You could also probably fix it by restructing your database if that is a posibility.
__________________
_______________________________
BlazingWolf
|