Returning empty or empty string in "IN CLAUSE" mysql php
I have this request:
SELECT * from tbl WHERE id = 1 AND option IN (1,2,3)
table:
+-------+---------+-------+
| id | option | votes |
+-------+---------+-------+
| 1 | 1 | 100 |
| 1 | 2 | 150 |
+-------+---------+-------+
As option no.3 doesn't exist in the table yet, I want it to return a null / empty string, so I can set 'votes' to 0 in my php code.
It currently gives me option lines 1 and 2 as expected.
+3
source to share