<?
$get_id = escape ( $_GET['cat'] );

mysql_select_db ( 'shop' );

$query = mysql_query ( "SELECT * FROM item WHERE id_cat='$get_id' ORDER BY id DESC LIMIT 4" );

while( $fetch = mysql_fetch_array ( $query ) ) {

$id_item = $fetch['id'];

$nome_item = $fetch ['nome'];

$descr = $fetch ['descri'];

$price = $fetch ['prezzo'];

$img1 = $fetch ['value'];

$img = "/homepage/itemshop/img/item/".$img1.".png";

echo "<div class='item '>
<div class='itemDesc'>
<span class='itype'></span>
<div class='thumbnailBgSmall'>
<img src='$img' width='63px' height='63px'>
</div>
<p>
<span class='itemTitle'>$nome_item</span>
<span class='line'></span>
<span class='shortDescriptionFix'>$descr</span>
</p>
<br class='clearfloat'>
</div>
<div id='item_694' class='purchaseOptionsWrapper'>
<form action='index.php?page=gekauft&id=$id_item&cat=$get_id' method='post'>
<div class='itemPrice'>
<div class='priceValue'>
<span>PREIS:</span>
<div class='price'>$price</div>
</div>
</div>
<a href='index.php?page=Infos&id=$id_item' title='mehr Informationen' class='purchaseInfo' onclick='return false;' ></a>
<input value='' title='kaufe Artikel' class='addToCard' type='submit'>
<br class='clearfloat'>
</form>
</div>
</div>";

}
?>