What dagon is talking about is that you count up to three with the while loop and when $i hits three the if statement gets executed.
This is what i would do:
// There's no need to use <?php, you can use <?, easier, takes less space
<?php $inflatable_query="SELECT id,title,image_url,thumb_url FROM products WHERE area=1 ORDER BY id;";
// Do you know what @ does? If not it tells the browser that if there's an error with the query he doesn't show it wich can be a pain if you forget about it and there is an error.
$inflatable_result=@mysql_query($inflatable_query);
while($inflatable_data=@mysql_fetch_array($inflatable_result)){
?>
// Why close php and reopen it to write html code?
<?php echo "<div class=\"inflatable-box\"> \n"; ?>
<?php echo "<div class=\"inflatable-box-image\"><a href=\"product-".$inflatable_data['id'].".php \" target=\"_blank\"><img src=\"".$inflatable_data['thumb_url']."\" width=\"200px\" height=\"200px\" border=\"0\" /></a></div>"; ?>
<?php echo "<div class=\"inflatable-box-text\">".$inflatable_data['title']."</div>
</div>"; ?>
<?php } ?>
Becomes:
<?
$inflatable_query="SELECT id,title,image_url,thumb_url FROM products WHERE area=1 ORDER BY id;";
$i=0;
$inflatable_result=mysql_query($inflatable_query) or die("An error has occured: ".mysql_error());
while($inflatable_data=mysql_fetch_array($inflatable_result)){
$i++;
if($i==3){
$open_div="<div>";
$close_div="</div>";
//If you wanna run this multiple times the reset $i
$i=0;
}
echo $open_div;
?>
<div class="inflatable-box">
<div class="inflatable-box-image">
<a href="product-<?=$inflatable_data['id'];?>.php" target="_blank"><img src="<?=$inflatable_data['thumb_url'];?>" width="200px" height="200px" border="0" /></a>
</div>
<div class="inflatable-box-text"><?=$inflatable_data['title'];?></div>
</div>
<?
}
echo $close_div;
?>
<?= is the same as <? echo or <?php echo