Wildhalf Posted February 26, 2008 Share Posted February 26, 2008 Hi All, I was wondering if anyone knew where i could ge my hand on or even give me an idea on how to get started on a script that returns everything from a database starting with a certain letter. What i am doing is like a phone book. there will be a list of businesses and when a visitor to my page clicks on a for example the site will display all the a business names. thanks kieron Link to comment https://forums.phpfreaks.com/topic/93079-a-z-script/ Share on other sites More sharing options...
freenity Posted February 26, 2008 Share Posted February 26, 2008 TO return everything starting with a letter just do: SELECT * FROM table WHERE `name` LIKE "A%" <--- Will return names starting with A. To make it with all letter you can use php: for ($i='A';$i<'Z";$i++) //make the select here but replace A% to $i% Link to comment https://forums.phpfreaks.com/topic/93079-a-z-script/#findComment-476888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.