I've got this code above:PHP Code:<?while($row = mysql_fetch_assoc($sql)) {
$i++;
if(IsEven($i)){
$even = "even";
} else {
$even = "odd";
}
$checksql = mysql_fetch_assoc(mysql_query("SELECT * FROM cms_badge_shop WHERE image='".$row['image']."'"));
$check = $checksql['error'];
?>
<?if($costum == 0){
$filename = $cimagesurl.$badgesurl.$row['image'].'.gif';
}else{
$filename = "http://images.habbohotel.co.uk/c_images/album1584/".$row['image'].".gif";
}
if(file_exists($filename)){
mysql_query("UPDATE cms_badge_shop SET error = '0' WHERE image = '".$row['image']."' LIMIT 1");
}else{
$image = './web-gallery/images/failbadge.png';
$erroredid = mysql_query("UPDATE cms_badge_shop SET error = '1' WHERE image = '".$row['image']."' LIMIT 1");
}?>
<li class="<?php echo $even; ?>">
<table style="width: 100%">
<tr align="center">
<?if (isset($image) && $check > 0 ){ ?>
<td style="width: 25%"><img src="<?php echo $image; ?>" /></td>
<?php }else{ ?>
<?if ($costum == 0){ ?>
<td style="width: 25%"><img src="<?php echo $cimagesurl.$badgesurl.$row['image'].".gif"; ?>" /></td>
<? }else{ ?>
<td style="width: 25%"><img src="http://images.habbohotel.co.uk/c_images/album1584/<? echo $row['image']; ?>.gif" /></td>
<? }} ?>
<td style="width: 35%"><b><?php echo $row['name']; ?></b><br /><?php echo $row['description']; ?></td>
<td style="width: 15%"><?php echo $row['cost']; ?></td>
<td style="width: 25%">
<a class="new-button fill" onclick="habboclub.buttonClick(<?php echo $row['id']; ?>,'Confirm Purchase'); return false;" href="#"><b>Buy Now</b><i></i></a>
</td>
</tr>
</table>
Basically, what it should do is, detect if the image exists, then updates the sql if it doesn't (error).
Then it will display the error image.
But because it's in a while loop: it all the ($row['image'])'s to 1
I'd love some help here. thanks iJames.

