Re: insert NULL to mysql table.

From: Date: Wed, 02 Jul 2003 13:30:15 +0000
Subject: Re: insert NULL to mysql table.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29021@lists.php.net to get a copy of this message
UPDATE un_issue SET i_editor = null WHERE i_date = '$issue'"
Thanks. But how come this works and sets i_editor to NULL "UPDATE un_issue SET i_editor = $editor WHERE i_date = \"$issue\"" but the following two gives me a sql-error "You have an error in your SQL syntax near 'WHERE i_date = ' at line 1" "UPDATE un_issue SET i_editor = $editor WHERE i_date = '$issue\'" "UPDATE un_issue SET i_editor = $editor WHERE i_date = $issue" and the following sets i_editor to 0, not NULL "UPDATE un_issue SET i_editor = '$editor' WHERE i_date = '$issue'" for all queries $editor = NULL and $issue = 2003-08-15 -- anders thoresson

« previous php.db (#29021) next »