I have a
$dummy = 1
$dummy = 2
$dummy = null
and a query and tried display it
$query = "select * from table1 where sy=2000 AND sy_dummy=$dummy";
echo $query;
then when $dummy=null
, I get
ERROR: syntax error at or near "order" LINE 2: AND sy_dummy= order by table1 ^
and i tried $dummy IS NULL
but gives me blank page.
My problem is that how can I put a NULL
value to my $dummy
and gives me something like the result should be .....sy_dummy IS NULL order by table1
not ......sy_dummy= order by table1;
Is this possible? Hope you understand my problem.