My status column in my Employee table should have two values Active and
Inactive. Right now all the active employees have the value Active and
the rest have a NULL value.
Why is it that the following commands do nothing?
UPDATE EMPLOYEE SET STATUS='Inactive' where STATUS != 'Active';
UPDATE
first off it would help if you specified what DB you are using and if
you are using a DB abstraction lib like PEAR::DB or something similar.
also have you tried running these lines directly in a cmdline sql client?
is the status column variable width? if not then the value may be
'Active '
for Inactive)
Bastien
From: Perry, Matthew (Fire Marshal's Office) [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] NULL VALUE
Date: Mon, 3 Jan 2005 11:40:52 -0600
My status column in my Employee table should have two values Active and
Inactive. Right now all the active employees have
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:16 PM
Subject: Re: [PHP-DB] NULL VALUE
LightBulbMoment (tm): 5 seconds of searching on the MYSQL site tells
me
STATUS is a keyword. try either renaming your field or using backticks
Norland, Martin wrote:
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:16 PM
Subject: Re: [PHP-DB] NULL VALUE
LightBulbMoment (tm): 5 seconds of searching on the MYSQL site tells
me
STATUS is a keyword. try either renaming your field
: Monday, January 03, 2005 2:16 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] NULL VALUE
Norland, Martin wrote:
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:16 PM
Subject: Re: [PHP-DB] NULL VALUE
LightBulbMoment (tm): 5 seconds
Hi Matthew,
there are some more comments below but just for the record could you
confirm that you are retrieving one or more rows when you issue the
following SQL:
SELECT * FROM `employee` WHERE `status` IS NULL;
if you are getting no rows back then the obviously updating based on the
status