View Full Version : Select specific records from MySQL database by clicking link

07-04-2005, 09:04 PM
I'm just looking for a vague idea of what this is called so I can google for tutorials and what-not.

Utilizing a MYSQL d-base I'd like to have a php page where a user can select a letter such as "S" and have all artists starting with an "S" listed.

Top of page: A, B, C, D, E, F,...... etc....., 1, 2, 3, 4,....

when someone selects "B" a list of table entries such as "beetles" "beatnuts" etc.. will appear

I'm sorry if this is a vague description of what I'm looking for but I'm in idea mode at the moment...

any direction would be appreciated.


07-04-2005, 09:37 PM
This is more of a MySQL question, but....

$sql = 'SELECT name, id FROM artists WHERE name ILIKE `'. $letter .'%` ORDER BY name ASC;'

That should do it for you.

07-05-2005, 04:42 PM
Sweet! Thanks Kurashu

07-05-2005, 06:14 PM
$sql = 'SELECT name, id FROM artists WHERE name LIKE `'. $letter .'%` ORDER BY name ASC;'

It's LIKE, not ILIKE.

07-06-2005, 07:26 AM
2) Type in a subject that summarizes your question- A great way to turn off other members wanting to help you is to type an incomplete or silly subject for your post. Examples of poor subject titles include:

- "Help!"
- "I'm a newbie...be gentle"
- "How can I..."
- "Urgent...deadline tomorrow!"

The above subjects either have absolutely nothing to do with the question itself, or are grossly incomplete (ie: "How can I..."). When asking for help, enter a subject that summarizes your question, period! Don't use silly, incomplete, or "bait" subjects. Some examples of good titles are:

- "How do I round a number to 2 decimal places using JavaScript?"
- "What's the difference between require() and include() in PHP?"
- "Can someone suggest a good, free HTML editor?"

Posting Guidelines (http://www.codingforums.com/postguide.htm) Read it, love it, learn it. A better title could have been "Select specific records from MySQL database by clicking link"