jcdevelopment
02-29-2012, 06:18 PM
I have this current code that easily spits out entered data along with a time stamp.
<?php
$db = mysql_connect('*','*','*');
mysql_select_db('*',$db);
$sel = "SELECT * from rsvp_101";
$q = mysql_query($sel,$db);
echo "<table>";
while ($row = mysql_fetch_assoc($q)) {
$first_name = $row['first_name'];
$last_name = $row['last_name'];
$office = $row['office'];
$guests = $row['guests'];
$date = $row['date'];
echo("
<tr><td>$first_name $last_name </td> <td>$office </td><td> Guests attending: $guests</td><td> $date</tr>
<tr><td> </td><td> </td></tr>
<tr><td> </td><td> </td></tr>
");
}
?>
I am just looking for a solution in PHP to add, in numerical order, a number on each line repeating. Does anyone know of a way so it will look something like this:
1 name office date
2 name office date
3 name office date
etc....
thanks for any help.
<?php
$db = mysql_connect('*','*','*');
mysql_select_db('*',$db);
$sel = "SELECT * from rsvp_101";
$q = mysql_query($sel,$db);
echo "<table>";
while ($row = mysql_fetch_assoc($q)) {
$first_name = $row['first_name'];
$last_name = $row['last_name'];
$office = $row['office'];
$guests = $row['guests'];
$date = $row['date'];
echo("
<tr><td>$first_name $last_name </td> <td>$office </td><td> Guests attending: $guests</td><td> $date</tr>
<tr><td> </td><td> </td></tr>
<tr><td> </td><td> </td></tr>
");
}
?>
I am just looking for a solution in PHP to add, in numerical order, a number on each line repeating. Does anyone know of a way so it will look something like this:
1 name office date
2 name office date
3 name office date
etc....
thanks for any help.