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