Table column default set to NULL, but NULL insert query makes a "0" instead.
I have got a table that has a columm that has the following settings:
Field (or name): Opponent
If I do an insert query using the below $team_id_opp variable the table new row will have a value of zero (0) instead of the value of NULL.
If I put single quotes or double quotes around NULL like below the table row still has a value of zero instead of NULL for the Opponent table cell value.
$team_id_opp = NULL;
INSERT INTO Games ( Opponent ) VALUES ('$team_id_opp') // Value for the Opponent cell turns out to be "0" instead of NULL
If I remove the $team_id_opp variable from the script altogether and do an insert query with no variable value at all it still inserts a 0 instead of the NULL value.
$team_id_opp = 'NULL'; // Still has 0 instead of NULL
$team_id_opp = "NULL"; // Still has 0 instead of NULL
Question. How can I make the Opponent column cell in a new row have the default NULL value instead of a value of 0?