I am trying to create OR condition dynamically using an array. Given an array, of course names $courses = array(\'Eng, \'Deu\', \'Bio\', \'Chemi\') I want to have a
$courses = array(\'Eng, \'Deu\', \'Bio\', \'Chemi\')
Instead of so many OR clauses, you can simply use IN(..):
OR
SELECT * FROM classe WHERE class = 'EFG' AND course IN ('Eng' ,'Deu', 'Bio')
In the PHP code, you can use implode() function to convert the array into a comma separated string, and use it in the query string generation.