IFNULL used in a UPDATE

From: Date: Wed, 13 Mar 2002 17:09:08 +0000
Subject: IFNULL used in a UPDATE
Groups: php.db 
Request: Send a blank email to php-db+get-17661@lists.php.net to get a copy of this message
Hello, I am new to SQL so I hope this is not a lame question. I want to UPDATE two fields ('box1' & 'box2') in table 'users'. One field I want to always set the current time. The other field I want to put the current time ONLY if it has the value NULL. Here is my attempt: UPDATE users SET IFNULL(box1 = NOW()), box2 = NOW() WHERE eMail = 'tracys@yahoo.com' Any help would be greatly appreciated. Jane. Using: MySQL 3.22.27

« previous php.db (#17661) next »