I am struggling a bit with my SQL query.
This is the query i have now, and it works as is, but i want to add some more to it.
In the mysql table, there is a column that is named “type”. I want to filter the rows and get the rows with the string “sms” or the string “email” from column “type”.
x
$query = "
SELECT id_card
, date_sent
, status
, recipient
, type
FROM dc_log
WHERE secretcode=?
AND date_sent BETWEEN ? AND ?
";
How do i add this to my query without messing everything up?
Thanks in advance.
Advertisement
Answer
Just add this condition in the end before the double quotes
AND type IN ('sms','email')