Author |
Message |
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Mon Jul 01, 2002 6:15 pm (22 years, 6 months ago) |
|
Right I have a mysql DB for me forum and a couple of people seem to have become deleted .
I have backups of the members table and can insert that no problem. The problem is with posts, basically they are associated with their poster by a member id column thingy. When a user is deleted the member id coloumn is set to -1.
What I need to do is run a query to change the member id to 604 where the username is say henry.
I cant for the life of me work out how to do it though.
Any ideas? |
________________________________ Ben Scott
Red and White Kop |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Jul 01, 2002 6:31 pm (22 years, 6 months ago) |
|
Something like this should work (not an expert though. the idea is all right, but the code isn't ):
Code: | REPLACE INTO tablename
SET fieldname=604
WHERE fieldname='Henry'; |
|
________________________________
|
|
|
|
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Mon Jul 01, 2002 8:34 pm (22 years, 6 months ago) |
|
heh, I know the kinda code I need.... just dont know the code |
________________________________ Ben Scott
Red and White Kop |
|
|
|
Ben
Senior WebHelper
Joined: 08 Jan 2002
Posts: 431
Location: Liverpool - UK
|
Posted:
Mon Jul 01, 2002 9:22 pm (22 years, 6 months ago) |
|
Asked on WHT and got the answer...
UPDATE yabbse_messages SET id_member = 604 WHERE postername = 'BOB';
Works fine |
________________________________ Ben Scott
Red and White Kop |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jul 02, 2002 1:33 pm (22 years, 6 months ago) |
|
I was soooo close It was just UPDATE instead of REPLACE |
________________________________
|
|
|
|
|