I am trying to sort my SQL database alphabetically by location. I executed the command: SELECT * FROM users ORDER BY location on the phpMyAdmin website, and the users are now indeed ordered alphabetically by location on the online database. However they still don't display in alphabetical order on our website. Here is the code where I output the relevant SQL data:
<div>
<table id="checkintable">
<tr>
<th>Name</th>
<th>Location</th>
<th>Comment</th>
</tr>
<? $result = mysql_query("SELECT fullname, location, comment FROM users"); ?>
<? while ($row = mysql_fetch_array($result)): ?>
<tr class="tables">
<td><?= $row["fullname"]?></td>
<td><?= $row["location"]?></td>
<td><?= $row["comment"]?></td>
</tr>
<br>
<? endwhile ?>
</table>
</div>
Am I doing something wrong in this code? I want to display the table in the same order that the online database is ordered in, but it isn't working.