Hi,
I have the following code to access data :
$get=mysql_query(“SELECT * FROM products WHERE catid = '”.$cat."’");
$total=mysql_num_rows($get);
$i=1;
while($rsProducts = mysql_fetch_assoc($get))
{
?>
photo=‘pics/<?=$rsProducts['id'];?>.jpg’;
photo=photo.replace(//2//,"/");
if(document.images){
photos[<?=$i;?>]=photo;
photo3.setAttribute(“src”,photos[<?=$i;?>]);
}
Problem is that this returns a mysql_fetch error if the query returns 0 records - which then looks ugly on the page.
Whats the best way round this?
Thanks