paulman888888 Posted May 29, 2008 Share Posted May 29, 2008 <?php // Make a MySQL Connection mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die('Theres an error.'); // Get all the data from the "example" table $result = mysql_query("SELECT * FROM example") or die('Theres an error.'); echo "<table border='1'>"; echo "<tr> <th>Name</th> <th>Score</th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['name']; echo "</td><td>"; echo $row['score']; echo "</td></tr>"; } echo "</table>"; ?> This is the code i am useing. I would like it to be arrached so that the highest score is at the top and lowest score is at the bottom. How could I do that? Please help. Thankyou Link to comment https://forums.phpfreaks.com/topic/107770-array-help/ Share on other sites More sharing options...
Daniel0 Posted May 29, 2008 Share Posted May 29, 2008 Seems like this one deals with the same problem. I'll close this one. Link to comment https://forums.phpfreaks.com/topic/107770-array-help/#findComment-552455 Share on other sites More sharing options...
Recommended Posts