genu Posted September 6, 2006 Share Posted September 6, 2006 How to I have it so when I fetch the database, it displays only results starting with a certain letter, and also show the "next" button if th results starting with that letter exceed 30 items? Link to comment https://forums.phpfreaks.com/topic/19848-alphabetical-filter/ Share on other sites More sharing options...
hostfreak Posted September 6, 2006 Share Posted September 6, 2006 For the letter you could do something like:[code]$letter = "A";$query = "SELECT * FROM table WHERE field LIKE '$letter%'";[/code]Per query or do something like:[code]$letter = $_GET['letter'];$query = "SELECT * FROM table WHERE field LIKE '$letter%'";[/code]And in your url have: http://www.domain.com/page.php?letter=A Or whatever the letter you want.On the 30 items per page, you need to look into pagination. Link to comment https://forums.phpfreaks.com/topic/19848-alphabetical-filter/#findComment-86880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.