PDA

View Full Version : HELP in mySQL


wolfe
17 Apr 2002, 11:20
hi i was woundering if anyone knows how i can do this

the prob is that i accidently deleted userid1 which was me :(

and all my 700 and odd posts went to userid0 = guest

so i reimported my self and all my posts are still guest


i was woundering if anyone knoe how you can Mass select posts in mySQL

only ones by me

and mass change them to

userid1


thanx in advance.

Neo
17 Apr 2002, 18:05
UPDATE posts SET userid='1', username='yourusername' WHERE userid='0'

or whatever it is equal to.

Chen
17 Apr 2002, 18:19
Originally posted by neo
UPDATE posts SET userid='1', username='yourusername' WHERE userid='0'
The name of the table is `post`, and you don't need to update the username. And that query will just make all the guest's posts to appear as his (even posts that wasn't posted by him).

Use this:
UPDATE post SET userid=1 WHERE username='YourUsername';

wolfe
17 Apr 2002, 22:50
thanx guys worked a treat

wolfe
17 Apr 2002, 23:00
is there anyway of making the posts and threads off a Old DataBase in the right order to add to a new database with posts already on it