Having this where clause :
The first and second placeholder ? can have values : 1 || NULL
The third place holder is dynamically added (array)
IF(ISNULL(?),1,xy.id) IN
(IF(ISNULL(?),1,(SELECT x.id FROM x WHERE name IN (?))))
I need this type isnull checking because i want the clause to always return true if data sent is null. Basically if data is null clause will be 1 IN 1 , if its not null find the corespondent ids , but if() function limits me to return only 1 result (not a set) .What options do i have here except dynamically build the whole query in php ?
You can do this in your
whereclause