SELECT t.name,p.* FROM `product` as p inner join `product_type` as t on p.p_type = t.id WHERE p.`del`='' And `p_type`='2' And `type`='Silver' ORDER BY p.`p_id` DESC
Code (PHP)
<table width="152px" border="0" align="center" cellpadding="2" cellspacing="2">
<?
$sqlz = 'SELECT t.name,p.* FROM `product` as p inner join `product_type` as t on p.p_type = t.id WHERE p.`del`=\'\' And `p_type`=\'2\' And `type`=\'Silver\' ORDER BY p.`p_id` DESC';
$resz = mysql_query($sqlz);
$cntz = mysql_num_rows($resz);
echo $sqlz;
$column = 3;
$i=0;
while($rows=mysql_fetch_assoc($resz)){
$i++;
if($i%$column==1)
echo "<tr>";
echo "<td>";
?>
<a href="product_collection_silver.php?id=<? $rows['p_id'];?>" title=" <? $rows['id_product'];?> : <? $rows['name_product'];?> <? $rows['name'];?> ( <? $rows['colour_product'];?> )" id="<? $rows['p_id']; ?>" class="SimGalThumb"><img src="uploads/product/product_silver/thumb/pic_<? $rows['p_id']?>.jpg" width="105" height="70" border="0" /></a>
<?
echo "</td>";
if($i%$column==0)
echo "</tr>";
}
//print_r.$rows['p_id'];
?>
</table>
$sqlz = 'SELECT t.name,p.* FROM `product` as p inner join `product_type` as t on p.p_type = t.id WHERE p.`del`=\'\' And `p_type`=\'2\' And `type`=\'Silver\' ORDER BY p.`p_id` DESC';
SELECT t.name,p.* FROM `product` as p inner join `product_type` as t on p.p_type = t.id WHERE p.`del`='' And `p_type`='2' And `type`='Silver' ORDER BY p.`p_id` DESC