So I am doing a search and I am using an implode in my select statement, which I find quite useful. Basically this search engine will have 3 different selects which will select different things based on different criteria and when I use my implode I get an error of invalid arguments passed.
Here is my sql statement:
$sql = "SELECT DISTINCT camp.title, camp.startDay, camp.typeOfCamp, camp.endDay,
camp.link FROM ((camp INNER JOIN gender ON camp.id = gender.camp_id)
INNER JOIN grades ON camp.id = grades.camp_id)
INNER JOIN interests ON camp.id = interests.camp_id
WHERE ((grades.year = '".implode('\' OR grades.year = \'',$age)."')
AND gender.gender = '".$gender."')
OR ((interests.activity = '".implode('\' OR interests.activity = \'',$array)."')
AND (grades.year = '".$age."' AND gender.gender = '".$gender."'))";
The second implode for the interests is where I began having my problem and $array is an array. Another thing I don't understand is that when I run my code I get the correct results, but I am still getting the error that I am passing invalid arguments.