|
php help
This goes with an automobile dealer script to add featured listings on the front page. As it is it lists all featured vehicles one over the other in a verticle row. What I want to do is have it list horizonally and be able to define how many before a new row is started (make sense)? In other words, three across, then start a new row.
Thanks in advance.
<?php
//EXAMPLE CODE:
//handles the listing of featured properties
$result = mysql_query("SELECT * FROM vehicles WHERE featured = 'Y';",$link);
while ($a_row =mysql_fetch_array ($result) )
{
//add commas to price
$a_row[price] = number_format ($a_row[price]);
print "<P>";
print "<a href=\"./carview.php?view=$a_row[id]\"><b>$a_row[title]</b></a><BR>";
//select images connected to a given listing
$query = "SELECT * FROM tbl_Files WHERE prop_num = $a_row[id] LIMIT 1";
$output = mysql_query("$query",$link);
$count = 0;
while ($image_row =mysql_fetch_array ($output) )
{
print "<a href=\"carview.php?view=$a_row[id]\"><img src='image.php?Id=$image_row[id_files]' border=1 width=100 alt=\"Photo\"></a><br>";
$count++;
}
if ($count == 0)
{
print "<a href=\"./carview.php?view=$a_row[id]\"><img src=\"./images/nophoto.gif\" border=1 width=100 alt=\"View Listing\"></a><br>";
}
print "$a_row[year] $a_row[model] $a_row[make]<BR>";
print "\$$a_row[price]<BR>";
print "<P>";
}
//END OF EXAMPLE
?>
__________________
"The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people."
|