I ran into a problem that I can't find on Google and now I need your help.
I have a variable that contains values separated by a comma:
$statusValue = "New, Test, Pro, Guru, Master";
And there is a query from the database that receives a list of contacts and contains the status
column (only one value is stored in it). How can I extract contacts from the database that contain one parameter from the status
value variable in the $statusValue
?
Full Code:
$statusValue = "New, Test, Pro, Guru, Master";
$request = "select * from contacts WHERE status = '$statusValue' ORDER BY id DESC";
$result = mysqli_query($mysql, $request);
I try this: (But it is of course doesn't work)
$request = "select * from contacts WHERE status = '$statusValue[]' ORDER BY id DESC";