When I do this query, it shows the 2 results but also 2 tables and need to only show one table with 2 results, which in this case 2 different images
Now I tried to just to the td tag and tr tag but nothing is showing up being normal.
What am I doing so wrong ? Please help me out here..
<?
$sql2 = "SELECT * FROM ads where state='1''";
$result = mysql_query($sql2);
while($row2 = mysql_fetch_array($result))
{
$id = $row2["id"];
$pid = $row2["pid "];
$url = $row2["url"];
?>
<center>
<table cellpadding="0" cellspacing="0" and border="0">
<tr>
<td height="20">
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image1.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=1"><img border=0, vspace=0 hspace=0 src="/blank/grey1.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image2.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=2"><img border=0, vspace=0 hspace=0 src="/blank/grey2.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image3.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=3"><img border=0, vspace=0 hspace=0 src="/blank/grey3.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image4.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=4"><img border=0, vspace=0 hspace=0 src="/blank/grey4.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image5.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=5"><img border=0, vspace=0 hspace=0 src="/blank/grey5.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image6.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=6"><img border=0, vspace=0 hspace=0 src="/blank/grey6.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image7.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=7"><img border=0, vspace=0 hspace=0 src="/blank/grey7.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image8.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=8"><img border=0, vspace=0 hspace=0 src="/blank/grey8.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image9.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=9"><img border=0, vspace=0 hspace=0 src="/blank/grey9.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image10.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=10"><img border=0, vspace=0 hspace=0 src="/blank/grey10.JPG" width="70" height="20"></a><?}?>
<? if($pid==0){?><a href="<? echo $url;?>"><img alt="<? echo $mouseover;?>" border=0, vspace=0 hspace=0 src="/images/image11.JPG" width="70" height="20"></a><?} else {?><a href="purchase.php?impur=11"><img border=0, vspace=0 hspace=0 src="/blank/grey11.JPG" width="70" height="20"></a><?}?>
<?}?>
</td>
</tr>