In a mysqli prepared statement, a NULL gets turned into \'\' (in the case of a string) or 0 (in the case of an integer). I would like to store it as a true NULL. Is there a
For anyone coming looking at this because they are having problems binding NULL in their WHERE
statement, the solution is this:
There is a mysql NULL safe operator that must be used:
<=>
Example:
prepare("SELECT id FROM product WHERE price <=> ?"); // Will select products where the price is null
$stmt->bind_param($price);
?>