$count=0;
$cars=@mysql_query("select * from 4wds where status='sold' order by highlight desc,timeadded desc");
if (@mysql_num_rows($cars)==0){echo "
There are no vehicles sold.
";}
while ($car=@mysql_fetch_array($cars)){
$count++;$divcount++;
if ($count==4){
echo "
\n";
$count=1;
}
echo "
\n";
list($photo)=@mysql_fetch_row(@mysql_query("select photo from 4wdgallery where 4wd='$car[id]' limit 1"));
if (!$photo){$photo="no-photo.gif";}
echo "
![OzWide4WD Bundaberg | Vehicles for sale | $car[title]](/4wdimages/".$photo.")
\n";
echo "
$car[title]
SOLD\n";
echo "
\n";
}
if ($count>0){
echo "
\n";
}
?>
include "footer.php";
?>