SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dropdown and sub dropdown problem

    Hi Guys

    I have a dropdown of locations. On selection it loads the next dropdown with sub locations

    The problem is these are linked together by a id

    So when they are entered into the database, the sublocation goes in fine but in the location box it enters the id

    How can i do it so that the location is entered into the database and not the id?

  2. #2
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dnbidder2005 View Post
    How can i do it so that the location is entered into the database and not the id?
    Entered or fetched?

    If fetched, you can get location title of a given sublocation with the code like this:
    Code SQL:
    SELECT l.title
      FROM locations AS l
    INNER
      JOIN sublocations AS s
        ON s.location_id = l.id
     WHERE s.id = $sublocation_id

  3. #3
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    153 Post(s)
    Tagged
    3 Thread(s)
    hi chris, can you post your code for the dropdowns?
    It might be that the option value will need to be amended slightly to take 2 variables.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  4. #4
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is now solved


Bookmarks

Posting Permissions

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