Problems using multiple joins for search
I am new to dreamweaver and coding and I am battling to get my head around joining tables and using multiple joins to create a search result recordset.
I have a the following tables setup;
Venues table
- venueID
- name
- category (text)
- city
- provinceID (numeric)
- country
- maxcapacity
Province table
- provinceID
- province (text)
Category Table
- categoryID
- category (text)
Max Conference Table
- conferencefacilitiesID
- venueID
- maxcapacity
I am passing the search $_POST variables via a form and displaying it in a results page.
I have successfully done the search using only one table the problem results in using multiple joins. I cam not sure of the syntax to use but have successfully created the results page, using the outer join to link the province, category and maxcapacity to the venues table. Not all the venues have conferencing so I think need to use outer join for conferencing.
I can't seem to access the search and not sure if I can use the WHERE command to set varialbe 'category' = varCategory
Below is my code which doesn't work;
SELECT wp_dbt_venues.venuesID, wp_dbt_venues.name, wp_dbt_venues.category, wp_dbt_venues.province, wp_dbt_venues.city, wp_dbt_province.provinceID, wp_dbt_province.province, wp_dbt_conferencefacilties.venueid, wp_dbt_conferencefacilties.maxcapacity
FROM ((wp_dbt_venues LEFT OUTER JOIN wp_dbt_province ON wp_dbt_venues.province = wp_dbt_province.provinceID) LEFT OUTER JOIN wp_dbt_conferencefacilties ON wp_dbt_venues.venuesID = wp_dbt_conferencefacilties.venueid)
WHERE 'category'=varCategory
I would like to get on variable working and then expand onto the others like WHERE maxcapacity < varCapacity
