imperialized Posted March 4, 2008 Share Posted March 4, 2008 I tried to do a search for this, but it didnt show any results. Its easy what I am trying to do, I just can't figure it out. Basically, I am working on my Member_list and i want to provide an alphabet of links (clickable by the user) and will display only the users whose name starts with that letter Such as: member_list.php?letter=A displays: Amanda Alex Aaron For letter=B Brandon Bernard you catch my drift, I just can't seem to figure it out :-\ Quote Link to comment https://forums.phpfreaks.com/topic/94332-select-from-a-database-by-first-character-of-a-string/ Share on other sites More sharing options...
discomatt Posted March 4, 2008 Share Posted March 4, 2008 Try this SELECT FROM `table` WHERE `string` LIKE 'a%' Quote Link to comment https://forums.phpfreaks.com/topic/94332-select-from-a-database-by-first-character-of-a-string/#findComment-483101 Share on other sites More sharing options...
imperialized Posted March 4, 2008 Author Share Posted March 4, 2008 Works perfectly. I had tried that, but I had a typo in my code and it was returning 0 results. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/94332-select-from-a-database-by-first-character-of-a-string/#findComment-483126 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.