SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast soltek's Avatar
    Join Date
    Apr 2004
    Location
    nnowhere
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Dynamic Rollover Menus from DB

    I have a site and am trying to setup the rollover menus to drop down the different locations that properties are available in.
    Background: When adding a property the site admin selects a city from a drop down menu, the contents of the drop down menu pull from a table called 'geo' where the site admin can add and remove different cities, once the site admin submits the listing, it is store in the table 'properties' and a field within that table contains the submitted city location.

    To create the rollover menus I have create a recordset for each the Office, Retail & Residential rollovers - 3 recordsets in total, one for each menu as there are different tables, but that's beyond this question.
    These recordsets poll the properties table for the instances of whatever cities have been entered and displays each city has a dropdown selection.
    I then use this city variable to populate the link for the drop down selection and link the visitor to whichever is the appropriate page

    Here is my question:
    How do I write the sql for these 3 recordsets to display only one instance for each city? Presently, There are say 3 listings in the db that contain 'Toronto' for the city and the dropdown menu shows 3 selections for Toronto, I just want one - how?? help!? ..please!

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    something like:
    Code:
    select 
        DISTINCT city, otherfields
    from
        table1
    group by 
        city
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •