displaying record number in a cell in a table
| From: | Peter Houchin | Date: | Wed, 27 Nov 2002 00:49:06 +0000 |
| Subject: | displaying record number in a cell in a table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126215@lists.php.net to get a copy of this message | ||
howdy,
I've had a look around and haven't been able to find what I'm after..
What I'm trying to do is display the number of each individual record with
in a table in a db WITH OUT relying on the records id, here what I've come
up with so far:
//get and count the number of records in the table
$result = mysql_query("SELECT count(*) AS num FROM resellers");
$num = mysql_result($result,0,"num");
//display the number of records
for ($i = 1; $i <= $num; $i++) {?>
<td><div align='center'>
<font class="content"><?//=$myrow['id']
print $i;?>
</font>
</div></td>
<?}
now this all works except that it displays 12345etc in every cell of the
html table when i need it to display as
1
2
3
4
5
etc
with each number on a new row in the html table ..
TIA & I hope i've made what am after clear enough...
Cheers
Peter
"the only dumb question is the one that wasn't asked"