wright67uk Posted May 9, 2013 Share Posted May 9, 2013 What would be the best way to make an alphabetical pagination list of MySQL results? eg. A | B | C | D | E would I simply need to assign GET variables to each letter, and then process the GET in a MySQL select? eg. <a href="page.php?letter=a>A | </a> <a href="page.php?letter=a>B | </a> <a href="page.php?letter=a>C | </a> <a href="page.php?letter=a>D | </a> <a href="page.php?letter=a>E | </a> I'm sure there is a more efficient way? Quote Link to comment https://forums.phpfreaks.com/topic/277819-alphabetical-pagination-a-to-z/ Share on other sites More sharing options...
PravinS Posted May 9, 2013 Share Posted May 9, 2013 This will help you <?php //For A - Z (Capital letters) for($c=65;$c<=90;$c++) { echo '<a href="page.php?letter='.chr($c).'">'.chr($c).'</a>'; } //For a - z (Small letters) for($c=97;$c<=122;$c++) { echo '<a href="page.php?letter='.chr($c).'">'.chr($c).'</a>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/277819-alphabetical-pagination-a-to-z/#findComment-1429234 Share on other sites More sharing options...
mac_gyver Posted May 9, 2013 Share Posted May 9, 2013 http://forums.phpfreaks.com/topic/277366-help-trying-to-create-a-dynamic-browse-by-page/?do=findComment&comment=1426892 Quote Link to comment https://forums.phpfreaks.com/topic/277819-alphabetical-pagination-a-to-z/#findComment-1429275 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.