| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Dec 2005
Posts: 208
![]() | [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: 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>";
__________________ + Domains I have for sale here
Last edited by JsteRmX; 09-11-2007 at 08:59 PM.
|
| |
| | #2 (permalink) |
| DNOA Certified Seller ![]() Join Date: Apr 2005 Location: Arizona
Posts: 3,680
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code:
__________________ Nombrex.com |
| |