Why is the output of null subtraction null 0? There is a table uuu with only one data entry, as shown below:
$ Aaa = false; query statement: 'select * from uuu where id = '. $ aaa
Whether the query returns false, '', or null, or what?
I tried this:
$ K = ''-''; $ k = null-null; echo $ k;
All outputs are 0.
Reply to discussion (solution)
$ Aaa = false;
$ SQL = 'select * from uuu where id = '. $ aaa;
Var_dump ($ SQL );
False is a null string when connected to a string.
The output is string (27) "select * from uuu where id ="
The preceding SQL mysql syntax failed. Therefore, false is returned, indicating that the query failed.
It depends on the variable value. do not use echo. use var_dump.
Your query command returns an empty record, so it doesn't matter whether it is false, '', or null
When the record set is not empty and the field value is null, all database functions except PDO can return ''(null string)
$ Aaa = false;
Query statement: 'select * from uuu where id = '. $ aaa
Null ??, Cause ?? There are matched IDs = false ??.
$ K = ''-'';
$ K = null-null;
Var_dump ($ k );