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? Quote Link to comment 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. 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.