Ask Experts Questions for FREE Help !
Ask
    heatherdamnit's Avatar
    heatherdamnit Posts: 2, Reputation: 1
    New Member
     
    #1

    Oct 24, 2007, 08:53 AM
    Creating a Category List and Results
    Hi, I am trying to create a "Buyer's Guide". The first page - buyersguide.php will have a drop down menu that is populated with the categories (advertising, accounting, construction, etc.) from the table Categories. Once the user selects the category they are interested in, it will take them to a results page (buyersguideresults.php) that will list all Members who fit into the category they choose.

    So, I have 3 tables:

    1. Members:
    MemberID, CompanyName, Phone, TollFree, Fax, Address, City, State, Zip, Website, Descriptions, Email

    2. MemberCategory:
    MemberCategoryID, f_MemberID, f_CategoryID

    3. Categories:
    CategoryID, CategoryName

    First off, after I populate the drop down menu - how do I get it to take you to the results page. Once on the results page, how do I show the members info for the selected category?

    Please help! I've been working on this for weeks and just can't seem to get it! Thanks!
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Oct 24, 2007, 08:59 AM
    Getting to the results page is PHP so I can't help there. But the SQL to populate the results would look like this:

    SELECT CompanyName, Phone
    INNER JOIN ON members.MemberID = MemberCategory.MemberID
    FROM Members, MemberCategory
    WHERE CategoryID = selectedcategory

    selected category is the variable where you store the category selected on the first page.
    heatherdamnit's Avatar
    heatherdamnit Posts: 2, Reputation: 1
    New Member
     
    #3

    Oct 24, 2007, 09:11 AM
    Thanks Scott, but it didn't work. Somehow when the user selects a category, that category ID has to be carried over to the next page. Then it will need to match that CategoryID that is in the Categories table, with f_CategoryID from the MemberCategory table. Then match the f_MemberID from the MemberCategory with the MemberID from the Member table.

    So basically, joining 3 tables. I hope this makes sense.

    Any clue on how to do this?
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Oct 24, 2007, 10:33 AM
    No you wouldn't need to join three tables, once you capture the CatergoryID you wouldn't need the Category table. But yes, you would have to carry the Category ID over to the next page, that's what selectedcategory is. Bbut I'm not sure how to do that.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

I don't know if this is the right category but. [ 3 Answers ]

I had a dream last night about being in a school shooting. It felt so real. It was kind of like my old high school campus mixed with the college campus I go to. We were running around and saw like 10 people with guns, then this girl shows up with a gun to us and starts shooting us. I felt like...

What category on W7 for Spouse on H4? [ 1 Answers ]

My wife is a dependent on H4, and therefore ineligible to work or to obtain an SSN. She arrived in the US in Dec 2006. For my 2006 return: 1) Does she need to get an ITIN if I want to file as 'married, filing jointly' 2) What category should I choose on form W7? My guess was (e) "Spouse of a US...

A question of category [ 3 Answers ]

Is there a guiding principle concerning topics posting in the "religion" category as opposed to the "spirituality" category. . They are seeming more one in the same to me, the neophyte?


View more questions Search