I would take another approach.

table 1 has only user_id
table 2 has flag values and key user_id
So you just insert rows or delete them in table 2. That's it.

Did I understand your problem?

Sie schrieben am Donnerstag, 19. Juli 2001, 20:24:17:

> 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



-- 
Herzlich
Werner Stuerenburg            

_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de



---------------------------------------------------------------------
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