DrTrans Posted August 18, 2009 Share Posted August 18, 2009 I need some help with figuring out sorting $connect = ('localhost','root',''); mysql_select_db("tester"); $query = "SELECT * FROM tester"; $result = mysql_connect($query); while($row=mysql_fetch_array($result)) { $id = $row['id']; $prop = $row['propertyname']; echo "$prop -- $id "; } Now i want it to sort it A to Z by first letter of $prop. Thanks DrTrans Quote Link to comment Share on other sites More sharing options...
bubbasheeko Posted August 18, 2009 Share Posted August 18, 2009 Hi DrTrans, Change your query to this: $query = "SELECT * FROM tester SORT BY tester DESC"; or it is ASC rather than DESC...kinda tired to think lol Quote Link to comment Share on other sites More sharing options...
DrTrans Posted August 18, 2009 Author Share Posted August 18, 2009 I goofed myself Would this be sufficent: $query = "SELECT * FROM tester where Active = '$active ' SORT BY tester ASC"; Quote Link to comment Share on other sites More sharing options...
DrTrans Posted August 18, 2009 Author Share Posted August 18, 2009 Just in case others are wondering i fixed this problem by doing this $query = "SELECT * FROM tester WHERE active = "$active" ORDER BY tester ASC"; Thanks Dr Trans Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.