Here is my dillemma, I am trying to implement search for my website, and what I have is multiple comboboxes, and the user can select an option and press search, I do however want to at least return what exists based on their selection, i.e if they leave section blank, and only select semester, then I should have something in my result set, or if they select semester, and instructor, and leave the others blank, then I should have something in my result set, unfortunately its not working. Here is my Query.
SELECT *
FROM CoursesTaught c
WHERE c.Section = :section
AND c.CourseName=:courseName
AND c.Semester=:semeste
AND c.programName=:ProgramName
AND c.CoordinatorName=:coordinatorname
Essentially what I want to do is do a check that if empty, or "n/a" then rather than 'AND' do an 'OR' but I can't figure it out.