grahamb314 Posted October 14, 2008 Share Posted October 14, 2008 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 More sharing options...
trq Posted October 14, 2008 Share Posted October 14, 2008 That query shouldn't work at all. Try... $result = mysqli_query($mysqli, "SELECT * FROM grahamb_test.booking ORDER BY day ASC"); Link to comment https://forums.phpfreaks.com/topic/128430-solved-order-by-asc/#findComment-665500 Share on other sites More sharing options...
grahamb314 Posted October 14, 2008 Author Share Posted October 14, 2008 perfect! Thanks Link to comment https://forums.phpfreaks.com/topic/128430-solved-order-by-asc/#findComment-665544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.