Hello
I am beginning to learn SQL and I am stuck trying to perform what should be a simple query.
Here's the form:
www.childactivityresource.com/search/
The form has multiple dynamic dropdowns.
category
subcategory
age1
age2
Here are my tables:
activity_listings:
activity_ID tinyint(10)
company_name varchar(60)
company_id char(3)
title varchar(60)
category varchar(40)
subcategory varchar(40)
free_notfree int(8)
age1 varchar(9)
age2 varchar(9)
description longtext
cat_id tinyint(3)
subcat_id (3)
category
cat_id tinyint(3)
category varchar(22)
companies
company_id tinyint(3)
company_name varchar(60)
address1 varchar(100)
address2 varchar(100)
city varchar(100)
state char(2)
zip_code varchar(10)
phone varchar(30)
email varchar(100)
URL varchar(100)
subcategory
subcat_id tinyint(4)
cat_id tinyint(3)
subcategory varchar(22)
I would like to be able to search for category, subcategory, and age group and have it pull the records that include all variables.
I just don't have a lot of experience with multiple joins/unions/AND/OR's if that's what i need so any help would be appreicated. Do I need to have multiple recordsets with multiple joins? I have seen some where the WHERE part of the query is dynamic, is that what i'm looking for here?
Let me know if i have been to vague or if you need more information.
Again, Any help would be great!!!
THanks!!!!