$multiples_names
is an array.
For eg $multiple_names = ['1','2','3','4'];
How do I pass it to php mysql query so that I can select all items pertaining to that array.
$multiple_names = $_POST['multiple_names'];
$multiple_names_array = implode(',', $multiple_names);
$stmt1 = $conn->prepare("SELECT * from attendance where name in (?) and today_date between ? and ? order by id ASC");
$stmt1->execute(array($multiple_names_array, $checkInDateFinal, $checkOutDateFinal));
I want the results of query to look something like that
Names Product
1 Product A
1 Product A
2 Product B
3 Product C
3 Product C
4 Product D
Try a lot of methods but still could not get the results I want.