Question:
When modifying the house information, there is a field which is the total number of floors, floorall, which is an int field and is allowed to be empty.
When modifying the information, if the value of this field is entered, the value will be written to the database. If no value is entered, the value will be written to the database. , how to write NULL
to the database?
This is what I wrote
if($floorall==''){$floorall=NULL;}
$db->query("updata tabel set floorall ='$floorall' ");
But the value written in this way is 0 instead of NULL
Answer:
Hello, please execute the following statement:
updata tabel set floorall = null