There is a table UUU, with only 1 data, as follows:
$AAA = false; Query statement: ' SELECT * from UUU where id= '. $aaa
Does this query return false, or ', or null, or what?
I tried this:
$k = "-"; $k = Null-null;echo $k;
The output is all 0.
Reply to discussion (solution)
$AAA =false;
$sql = ' SELECT * from UUU where id= '. $aaa;
Var_dump ($sql);
False is an empty string when connected to a string
Output is String ("select * from UUU where id=")
The above SQL MySQL syntax detection does not pass so you return false to indicate that the query failed
To see the value of the variable, do not use echo, use Var_dump
Your query directive returns an empty record, so it doesn't matter if it's false, or ', or null
When the recordset is not empty and the field value is null, except that PDO can be specified, other database functions return "(empty string)
$AAA = false;
Query statement: ' SELECT * from UUU where id= '. $aaa
Return to empty???? There are??。 matching id=false.
$k = '-';
$k = Null-null;
Var_dump ($K);