Quote:
Originally Posted by masonite85
Maybe there is a better way of achieving this, It makes my head hurt too...
|
i think you're doing it wrong
the "cross joins" that you have are needlessly complex
based on the form that you linked to, there is a much simpler approach
you will have to rewrite your php code, though
what is involved is simply to test each of the form fields that a user can check, and optionally generate WHERE clause conditions based on those choices
for example, if the user does not check anything, your query should look like this --
Code:
SELECT *
FROM Schools
if the user checks off English and NCAA then the query should look like this --
Code:
SELECT *
FROM Schools
WHERE English = '$englishDisicipline'
AND NCAA = '$NCAAtype'
if the user checks off both Western and English along with NCAA then the query should look like this --
Code:
SELECT *
FROM Schools
WHERE ( Western = '$westernDisicipline'
OR English = '$englishDisicipline' )
AND NCAA = '$NCAAtype'
see the pattern?