Hi

I have been searching through the manual and the list archives for the last
few days regarding a problem I have with the SET column type.

I'm creating an app that uses a SET column as 'flags'. Different parts
within the application will check to see if certain 'flags' are enabled. As
I understand, the SET column uses bit representation internally.

My problem is updating the column with flags already set. Below is an
example:

The table is as follows:

CREATE TABLE users ...
        user_id INT ...
        user_flags SET('another','test','pass_renew','none') NOT NULL DEFAULT
'none'
        ...

When I update a record, I can only set the whole string not just the
individual flag.

i.e. This works fine...

UPDATE users SET user_flags = 'test, none' WHERE user_id = 1

How can I add (or remove) values within the SET column without affecting the
existing contents?

I've tried a number of ways with no success!!
For example

UPDATE users SET user_flags = CONCAT(user_flags,'pass_renew') WHERE user_id
= 1

Any help or pointers would be greatly appreciated.

Thanks

Nick Brandon
P.S. Please cc my email address as I'm not subscribe to the list - Thanks


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to