PDA

View Full Version : HELP in mySQL


wolfe
04-17-2002, 09:20 AM
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
04-17-2002, 04:05 PM
UPDATE posts SET userid='1', username='yourusername' WHERE userid='0'

or whatever it is equal to.

Admin
04-17-2002, 04:19 PM
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
04-17-2002, 08:50 PM
thanx guys worked a treat

wolfe
04-17-2002, 09:00 PM
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