PDA

View Full Version : how to have multiple drop down menus search results


nanny
03-01-2009, 03:45 AM
Hi I had this working for me years ago in php4 but now it won't work and no matter what I do it results to nothing. I even tried doing a url string that used to work from a link but the results still come up wrong.

I have a table called listing and the foreign keys are drop down menus:
industryid and classcatid and inv_state. I want people to be able to search via country - e.g. Australia, New Zealand.


SELECT listing.listingID, listing.classcatid, listing.industryid, listing.title, listing.inv_company, listing.tel, listing.contactphone2, listing.contactfax, listing.inv_state, listing.inv_addr1, listing.inv_addr2, listing.inv_zip, listing.inv_country, listing.status, class_category.pic, listing.adscreation_date
FROM listing INNER JOIN class_category ON class_category.classcatid = listing.classcatid INNER JOIN industry ON industry.industryid = listing.industryid INNER JOIN inv_state ON inv_state.inv_state = listing.inv_state INNER JOIN country ON country.inv_country = listing.inv_country
WHERE ( listing.status = 'notactive') AND ( listing.inv_country = 'New Zealand' ) AND (listing.classcatid LIKE '%Category%' ) AND (listing.industryid LIKE '%Type%') AND ( listing.inv_state LIKE 'Code%') AND (listing.inv_addr2 LIKE 'City%')
ORDER BY listing.classcatid ASC


I don't know what I am doing wrong and it seems to be getting fairly complex. Any suggestions?


Thanks...

davidj
03-01-2009, 08:04 AM
post your code please