Hi,
I have a WHILE loop that reads out info from all the rows in a MySQL table, but it reads it from top to bottom, therefore the newest information in the table (which gets inserted at the bottom) is read last and end up at the bottom of my readout page. I’m trying to either read the table from bottom to top, or insert new information at the beginning of the table (preferably the former). I have a field called ‘chron’ with an auto-incrementing MEDINT if that matters.
Here’s the while loop:
[code=php]
$query = “SELECT name, date_q, question, date_a, answer FROM $table”;
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo “<tr>
<th>{$row[‘name’]}:<br><h5>{$row[‘date_q’]}</h5></th>
<td>{$row[‘question’]}</td>
</tr>
<tr bgcolor=”#e5e5e5″>
<th>Chef Roy Answered:<br><h5>{$row[‘date_a’]}</h5></th>
<td>{$row[‘answer’]}</td>
</tr>
<tr><td white=”yes” colspan=”2″></td></tr>”;
}
Thank you!