1219 Posted May 3, 2008 Share Posted May 3, 2008 I have a list here in static HTML. http://www.donjo.net/where_to_buy.html I have worked on being able to insert store, address, state, URL, phone into a database, however, I am having problems organizing it so that it seperates the stores in the database by State and listing them as in the static version. Thanks Adam Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/ Share on other sites More sharing options...
IsmAvatar Posted May 3, 2008 Share Posted May 3, 2008 Have you tried ORDER BY? Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/#findComment-532279 Share on other sites More sharing options...
1219 Posted May 3, 2008 Author Share Posted May 3, 2008 I have setup a temp page here: http://www.donjo.net/test/ I am using: SELECT * FROM storeRetailers GROUP BY state ORDER BY state ASC But in the html body it now only shows one store per state instead of them all. Is something wrong with the HTML ia have for state and displaying the address/retailer. Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/#findComment-532287 Share on other sites More sharing options...
IsmAvatar Posted May 3, 2008 Share Posted May 3, 2008 remove the Group By. That's what's killing the results. The Order By will automatically group them, simply because 1 and 1 appear between 0 and 2 :-) Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/#findComment-532293 Share on other sites More sharing options...
1219 Posted May 3, 2008 Author Share Posted May 3, 2008 But i want the states to show only once per. So if Alabama has 3 stores, I only want Alabama listed once. Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/#findComment-532297 Share on other sites More sharing options...
1219 Posted May 3, 2008 Author Share Posted May 3, 2008 Similar to how this site lists its stores: http://www.innerasiarugs.com/storelocator/print.php Link to comment https://forums.phpfreaks.com/topic/103964-how-to-organize-a-phpmysql-list-by-state/#findComment-532300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.