Following is my code in which i am trying to display the values from the same table but in different columns of my HTML table with different ids like lets suppose my table has three columns then in each column the distinct value get displayed
All i want that my respective id changes on each column of the data being displayed from same table
Something like : Values of ID1 | Values of ID2 | Values of ID3
But currently my do while is working something like this: Values of ID1 | Values of ID1 | Values of ID1
Kindly let me know how can i fix my following code:
<table width="714" height="318" border="0" align="right" cellpadding="2" cellspacing="0">
<?php $count=0; do {
{ ++$count;
?> <tr>
<td width="231" height="288" valign="top" background="images/viv.png"><div align="center"><img src="get.php?id=<?php echo $row_Recordset1['ID']; ?>" width="270" height="270" /><br />
<br />
<a href="get_deal.php?id=<?php echo $row_Recordset1['ID']; ?>"><img src="button.png" width="182" height="36" border="0" /></a><br />
<br />
</div></td>
<td width="231" valign="top" background="images/viv.png"><div align="center"><img src="get.php?id=<?php echo $row_Recordset1['ID']; ?>" width="270" height="270" /><br />
<br />
<a href="get_deal.php?id=<?php echo $row_Recordset1['ID']; ?>"><img src="button.png" width="182" height="36" border="0" /></a><br />
<br />
</div></td>
<td width="231" valign="top" background="images/viv.png"><div align="center"><img src="get.php?id=<?php echo $row_Recordset1['ID']; ?>" width="270" height="270" /><br />
<br />
<a href="get_deal.php?id=<?php echo $row_Recordset1['ID']; ?>"><img src="button.png" width="182" height="36" border="0" /></a><br />
<br />
</div></td>
</tr>
<tr>
<td height="23" valign="top"> </td>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<?php }
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
if ($count == 0)
echo '<span style="font-family:Tahoma;color:white;font-size:200%">No Deals Available</span>'; ?>
</table></td>
</tr>
</table>
$row_Recordset1will not be set and you'll end up with links like<a href="get_deal.php?id=">. This is because you're using ado{...} while()loop instead of a standardwhile(){...}loop.