PDA

View Full Version : How to delete usergroup id


dip1232001
09-03-2008, 03:39 AM
How to delete usergroup id from user table for a specific user ..
I mean i need a mysql query to delete a vip userid if he or she's subscription is cancelled..
so i have to remove the specific usergroup id from mysql--->my database--->specific user table..

can any one hel please ...
thank you

suppose vip usergroup id= 49
and user's main usergroup id = 5
and in membergroupids =49,50,89

The 49 is inserted in membergroupids as he have purchased the subscription.
now when ever the susbcription is cancelled which query should be done to delete 49 from his
membergroupids

:D:D

Marco van Herwaarden
09-03-2008, 09:36 AM
Would be easier using PHP then trying to do this in a single MySQL query i guess.

dip1232001
09-03-2008, 11:02 AM
see i am quite new in php and mysql so any kind of help will be use full if oyu kidly give a hint how to do this thank you ..

dip1232001
09-05-2008, 08:19 PM
Can any one help me here i just wanna create a corn job to do this so it will require php i know.but if any one can give me any hint thank you

Marco van Herwaarden
09-06-2008, 08:02 AM
Read from the database. Use explode() to turn the comma seperated list of membergroupids into an array. Remove the element you don't need anymore. Use implode() to turn it into a comma sepratd list again and write back to database.

dip1232001
09-06-2008, 01:29 PM
thanks thank you very much i am giving it a try ....