im trying to make 4 columns with whatever i retrieve from the database... the inner while statement doesnt seem to move the index 'extract' index to the next value... i cant find a command that would move it to then next value... anybody have any ideas?
this is what i end up getting...
the first row is displays the first product four times then moves to the next product on the next row. i want to have extract move to the next product on the next column..
can anybody help me?
<?
While ($row = mysql_fetch_array($result))
{
$counter =4;
While (($row = mysql_fetch_array($result)) AND ($counter > 0))
{
extract ($row);
$image1 = $Pphotoloc;
$desc1 = $Pdesc;
extract ($row);
$image2 = $Pphotoloc;
$desc2 = $Pdesc;
extract ($row);
$image3 = $Pphotoloc;
$desc3 = $Pdesc;
extract ($row);
$image4 = $Pphotoloc;
$desc4= $Pdesc;
$counter--;
}
echo '
<tr>
<td align=left valign=top><a href="../product.php"><img src="../../images/products/newproducts/'.$image1.'.jpg" width="100" height="100" border="0"></a><br>'.$desc1.'</td>
<td align=left valign=top><a href="../product.php"><img src="../../images/products/newproducts/'.$image2.'.jpg" width="100" height="100" border="0"></a><br>'.$desc2.'</td>
<td align=left valign=top><a href="../product.php"><img src="../../images/products/newproducts/'.$image3.'.jpg" width="100" height="100" border="0"></a><br>'.$desc3.'</td>
<td align=left valign=top><a href="../product.php"><img src="../../images/products/newproducts/'.$image4.'.jpg" width="100" height="100" border="0"></a><br>'.$desc4.'</td>
</tr>'
;
}
?>