Jump to content

[SOLVED] order by asc


grahamb314

Recommended Posts

Hi all,

This doesn't seem to want to work:

$result = mysqli_query($mysqli, "SELECT * FROM `grahamb_test`.`booking` ORDER BY 'day' ASC");

echo "<table border='1'>
<tr>
<th>Name</th>
<th>Slot</th>
<th>Day</th>
<th>Month</th>
<th>Year</th>
</tr>";

while($row = @mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['name'] . "</td>";
  echo "<td>" . $row['slot'] . "</td>";
  echo "<td>" . $row['day'] . "</td>";
  echo "<td>" . $row['month'] . "</td>";
  echo "<td>" . $row['year'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

the day field is an int and I want to order by day asc. The fields echo in the table, but in a random order and not by day!

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/128430-solved-order-by-asc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.