Forum Moderators: coopster
I'm tring to output a mysql table data and display them using html table. It's easy to display one data per row, but what I really need to display 3 different data in one html table row. I know it will need some kind of increment operator inside the While loop, could you please tell me how? thanks
// Here echo some table stuffs but no TD and TR
//$num= num of rows to work with
$num=mysql_numrows($result);
$i=0;
while ($i <$num)
{
$username= mysql_result($result,$i,"username");
$id= mysql_result($result,$i,"id");
$email= mysql_result($result,$i,"email");
echo"<tr>";
echo"
<td width='33%'>$username</td>
<td width='33%'>$id</td>
<td width='33%'>$email</td></tr>
";
$i++;
}
echo"</table>";
<edit>
You might want to review Extracting data from MySQL [webmasterworld.com]
</edit>
review Pagination [webmasterworld.com]