Web Hosting Talk







View Full Version : Alter table?


Scotty_B
07-01-2002, 04:55 PM
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.

The table is called members, the column with the member ID is called ID_MEMBER and the column with the members name is called posterName

So I'm wanting to change value of ID_MEMBER column to 604 from -1 where the value of posterName is bob

I'v looked on the mysql site but cant work out what query I need though :(

Any ideas?

Cheers

ScottD
07-01-2002, 05:09 PM
UPDATE members SET id_member = 604 WHERE postername = 'BOB';That should do the trick for you. Of course, replace proper names and values where appropriate.

Scotty_B
07-01-2002, 05:10 PM
Ta, will give it a go in a sec

Scotty_B
07-01-2002, 05:21 PM
That did the trick nicely.

Appreciate it

Cheers

Ben

ScottD
07-01-2002, 05:24 PM
Great :)

Good luck!