|------------------ ------------------- -------------------|
| Name 1 | Name 2 | Name 3 |
|------------------| ------------------|-------------------|
| IMAGE1 | IMAGE1 | IMAGE2 | IMAGE2 | IMAGE3 | IMAGE3 |
|----------------- | ------------------|-------------------|
| Name 4 | Name 5 | Name 6 |
|------------------| ------------------|-------------------|
| IMAGE4 | IMAGE4 | IMAGE5 | IMAGE5 | IMAGE6 | IMAGE6 |
|----------------- | ------------------|-------------------|
This is my php script
<?php
include_once("abc.php");
$query=mysql_query("select * from dbts LIMIT 6");
echo'<table>';
$i=0;
while($sam=mysql_fetch_array($query))
{
$image = $sam['image'];
$name= $sam['name'];
if($i==0)
{
echo '<tr>';
}
echo '<td width=180 border=1 COLSPAN=2>'; print"$name"; echo '</td>';
if($i==2)
{
echo '</tr>';
$i=-1;
}
$i++;
if($i==0)
{
echo '<tr>';
}
echo '<td width=90>'; print"<img src=$image width=90 height=100/>"; echo '</td>';
echo '<td width=90>'; print"<img src=$image width=90 height=100/>"; echo '</td>';
if($i==2)
{
echo '</tr>';
$i=-1;
}
$i++;
}
echo '</table>';
?>
Above is the table i want from the php, Can you please help me to understand what I am doing wrong with code and point me in the right direction? or please correct my code according to my above table.