Forum Moderators: open
<?php
$prod = @$_GET['prod']; // Current Category ID
$imagerank="SELECT * from products WHERE pID='" . $prod . "' ";
$resultrank2=mysql_query($imagerank);
?>
<?php
while ($sSQL3 =mysql_fetch_array ($resultrank2) )
{
$simage1 = $sSQL3['pSmall1'];
$simage2 = $sSQL3['pSmall2'];
$simage3 = $sSQL3['pSmall3'];
$simage4 = $sSQL3['pSmall4'];
$limage1 = $sSQL3['pLarge1'];
$limage2 = $sSQL3['pLarge2'];
$limage3 = $sSQL3['pLarge3'];
$limage4 = $sSQL3['pLarge4'];
if(($simage1<=0) && ($simage2<=0) && ($simage3<=0) && ($simage4<=0)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> <br><a href=\"javascript:popImage('$limage3','Image')\"><img src='$simage3' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage4','Image')\"><img src='$simage4' width='100' height='100' border='0'> </a> ";}
else if(($simage1<=0) && ($simage2<=0) && ($simage3<=0) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> <br> <a href=\"javascript:popImage('$limage3','Image')\"><img src='$simage3' width='100' height='100' border='0'> </a> ";}
else if(($simage1<=0) && ($simage2<=0) && ($simage3>=1) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> ";}
else if(($simage1<=0) && ($simage2>=1) && ($simage3>=1) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> ";}
else if(($simage1>=1) && ($simage2>=1) && ($simage3>=1) && ($simage4>=1)){
print " ";}
}
?>