RON_ron Posted September 6, 2010 Share Posted September 6, 2010 I need to pull data in an alphabatical order based on a certain field. I'm trying to display the results, sorted according to the alphabatical order of the data in addressz... The my code dosen't do that, it pulls the data according to the order which I've entered the data. $SomeVar = $_POST['sta']; $query = "SELECT * FROM shops WHERE statez = '".$SomeVar."' ORDER BY addressz ASC"; $results = mysql_query($query); Quote Link to comment https://forums.phpfreaks.com/topic/212644-alphabatical-order/ Share on other sites More sharing options...
kickstart Posted September 6, 2010 Share Posted September 6, 2010 Hi What you have should work, assuming it is an alphanumeric field. Can you try your SQL directly on the DB (ie, through something like phpmyadmin) All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/212644-alphabatical-order/#findComment-1107790 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.