Results 1 to 21 of 21
Aug 13, 2012, 07:18 #1
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.
$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
$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?