Using the following code:
<table border="1" >
<?
$item_count=0;
$select_SQL="select * from iplay_test";
$result=mysql_query($select_SQL,$con);
while($eachRow= mysql_fetch_array($result))
{
if($item_count%3==0)
{
echo "<tr><td> 0 </td></tr>";
}
else
{
echo "<td> 1</td>";
}
$item_count++;
}
?>
</table>
I am getting the output ,
0
1 1
0
1 1
0
1 1
0
1 1
0
1 1
But I should be getting something like
0 1 1
0 1 1
0 1 1
What am I missing here?
I am basically doing this to get 3 items displayed per row. The data to be displayed will be from a database. Is there any better solution for this problem?.
Changing the code as below, solved my problem. Thanks to Jasha