Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Location
    Nashville
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select specific records from MySQL database by clicking link

    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.

    Thanks

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    Nashville
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .

    Sweet! Thanks Kurashu

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $sql = 'SELECT name, id FROM artists WHERE name LIKE `'. $letter .'%` ORDER BY name ASC;'

    It's LIKE, not ILIKE.

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts

    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 Read it, love it, learn it. A better title could have been "Select specific records from MySQL database by clicking link"
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •