- Impact
- 2
[resolved] PHP echos table. How to automatically number rows?
So I pulled some data from a mysql database and have it echoed into an html table. How can i make the HTML table automatically number the rows? I want the row #s to be independent from the mysql data so that i can sort by different variables.
Here is the code:
help is appreciated. Thank yoU!!
So I pulled some data from a mysql database and have it echoed into an html table. How can i make the HTML table automatically number the rows? I want the row #s to be independent from the mysql data so that i can sort by different variables.
Here is the code:
Code:
echo "<table border='0' p class ='style15' align='left'>
<tr>
<th>Student Name</th>
<th>Speech Title</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['speech'] . "</td>";
echo "</tr>";
}
echo "</table>";
help is appreciated. Thank yoU!!
Last edited: