Forum Moderators: coopster
This is where i've got to:
$query ="SELECT * FROM promo WHERE catalogue = '$cat' AND offer_type = 'new products' ORDER BY created DESC LIMIT 2";
$result = mysql_db_query ($database, $query);
if($row = mysql_fetch_array($result)){
echo "<div class=\"cats_newprods_1\">";
echo "<img class=\"cat_prod_img\" src=\" ";
echo $row['main_image_thumb'];
echo " \" \>";
echo "<h2 class=\"other_cat_header\">";
echo $row['page_title'];
echo "</h2>";
echo "<p class=\"pagetext\">";
echo $row['pg_description'];
echo "</p>";
echo "</div>";
}
else {
echo "<p class=\"pagetext\">There are currently no new products available from the Fisher Scientific $cat catalogue at this time</p>";
}
This works fine apart from it only displays ONE item as it is not a WHILE loop. How can i turn this into a while loop with the relevant IF statement?
Many thanks in advance.
Ryan