PDA

View Full Version : While and IF function? Mysql


Garrey
03-16-2010, 11:27 AM
Okei,
I have a code where user send SMS and then it will add username with other stuff to database. But I need to get somehow to add new permissionst by SMS. So, i made screenie about this because I have no idea how to describe this.

http://i43.tinypic.com/ej8zkz.jpg

Old Pedant
03-16-2010, 08:06 PM
I'm not a PHP user, but ...

Couldn't you just do:

UPDATE table SET permissions = CONCAT('a', permissions)
WHERE username = 'xxxx'
AND permissions IN ('bcdfet', 'jsdkas' )

And then find out if the record was updated or not?

Oh, wait...that won't find a username that exists but does *NOT* have either of those permissions.

Hmmm... But you don't have a path/choice for that in your diagram, either.