Jump to content

Format MySQL Results with PHP


delamatrix

Recommended Posts

Hi guys,

 

I'm working on some code that pull some records from a test db. I actually got the records to display 4 cells across in a html table, but I can't get the fifth record and so to start on a new row. The code is below:

 

 


...snip...

<table border="1">
</tr>
<?$i=0;
while ($i < $num && $i < $limit) {
$name=mysql_result($result,$i,"name");
$age=mysql_result($result,$i,"age");
?>
<td>
<? echo $name; ?>     <? echo $age; ?></td>
<?
$i++;
}
echo "</tr>";
?>

</table>


 

Any help would be greatly appreciated.  Thanks in advance.

 

-Delamatrix

Link to comment
https://forums.phpfreaks.com/topic/129491-format-mysql-results-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.