I will no longer explain NULL, others have done it.
When running SQL with PHP, please always try to use PDO .
Example
$name = (!isset($_POST['name']) || empty($_POST['name']) ? NULL : $_POST['name'];
This suggests that if your $ _POST is either not set or empty, set the value of $ name to NULL. Otherwise, use $ _POST ['name'].
Now when you bind $ name in a prepared SQL statement, you will have either a NULL string value or a name string.
source share