Jump to content

A - Z Script


Wildhalf

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.