Hi ,
Im currently building an online shop , on the display products page i want to display 3 images across and then add a CSS/html clear. Ive tried counting the rows and then saying if the num_rows is = to say 3 put the clear in but its adding it after all images
[php]
if($wineType && $region ){ // check if both winetype & region are selected
$q = mysql_query(“SELECT * FROM wines WHERE wine_type = ‘$wineType’ AND region = ‘$region’”);
while($row = mysql_fetch_assoc($q)){
$id = $row['id'];
$code = $row['product_code'];
$name = $row['product_name'];
$desc = $row['product_desc'];
$wineType = $row['wine_type'];
$wineRegion = $row['region'];
$volume = $row['volume'];
$price_1_6 = $row['price_1_6'];
$price_1_6_b = $row['price_1_6_b'];
$price_6_plus = $row['price_6_plus'];
$price_6_plus = $row['price_6_plus_b'];
$year = $row['vintage_year'];
echo '<div>';
echo "Product Code :$code"."<br />";
echo "Product Name : $name"."<br />";
echo "Product Description $desc"."<br />";
echo "Wine Type : $wineType"."<br />";
echo "Region :$wineRegion"."<br />";
echo "Volume : $volume"."<br />";
echo "Price 1-6 Bottles : $price_1_6"."<br />";
echo "Price 1-6 bottles(bus) : $price_1_6_b"."<br />";
echo "Price 6+ : $price_6_plus"."<br />";
echo "Price 6 +(bus) : $price_6_plus"."<br />";
echo "Vintage / Year : $year"."<br />";
echo '<img src="../images/wine-images/'.$id.'.jpg"/>';
echo '</div>';
}
}
[/php]
The code above is my while loop , any help would be great thanks