PHP/MySQL: Listing strings from a field

Discussion in 'Mac Scene' started by Rower_CPU, Jun 19, 2003.

  1. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #1
    Here's something I'm running up against in a project at work. We are developing a system that allows people to upload content to us, filling out some text fields, etc. I want to use the values from one field in the database table to build a menu. Here's the catch: There will be matching strings in separate records in the field. For instance,
    1, French, blah, blah
    2, German, blah, blah
    3, English, blah, blah
    4, French, blah, blah

    I don't want a menu that goes French, German, English, French, but leaves out a language once it's already been listed. I know I can do this by making a separate table to list the languages, but I'd prefer not to.

    Anyone know how to do it?
     
  2. thread starter Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #2
    Nevermind. I posted to DevShed and got my answer.

    "SELECT DISTINCT language FROM table"
     

Share This Page