Okay so i am rewriting some old queries, but the WHERE IN clause aint working like it used to in my old SQL? it basically only take "1" from the checked variable
$checked = "1,2,3";
New prepared statement
$stmt = $dbCon->prepare("SELECT id FROM rating WHERE category IN (?)");
$stmt->bind_param('s', $checked);
$stmt->execute();
$stmt->bind_result($id);
$randomArr;
while($stmt->fetch()){
echo $id . "<br>";
}
echo "<br><br>";
Old Query which works
$sql = "SELECT id FROM rating WHERE category IN ($checked)";
$result_user_stemmer = $dbCon->query($sql);
$arr_alle_billeder;
while ($obj = $result_user_stemmer->fetch_object()) {
// for hver user_source billedet IKKE skal vises
echo $obj->id . "<br>";
}
Example output link here