View Single Post
Old Jan 28th, 2006, 1:43 PM   #2
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
$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
BlazingWolf is offline   Reply With Quote