I have an array called $type which I need to put into an SQL query,
The problem is I dont know how many records $type will have when I submit the query...
$sql="SELECT * FROM tutor_question WHERE questionId in (SELECT questionId FROM tutor_question_list_questions WHERE listId = " . $lid . ")";
Is there any way I can do a foreach loop within the query above to do something like this?
....AND
foreach ($type as $t) {
echo $t;
}
I need to only extract the questions that fit the specific type I'm looking for.
I have tried a few combinations but cant get anything to work, can anyone help?
$typeto? Just useIN ([list of values for $type])inwithout knowing the structure of your$typearray.