PDA

View Full Version : Copying information in the database, vb3


Kohhal
01-29-2004, 12:48 PM
I have a custom field in the user table that still contains a lot of info from vB2.

I want to use this information and have created a new user profile field(stored in table userfield) where it is to be used. How can I copy all that info from the old field to the new one?

Thanks,

G :)

Andreas
01-29-2004, 12:53 PM
If you are using a mySQL-Version that is capable of multi table updates:

UPDATE userfield, user SET userfield.fieldx=user.oldfield WHERE userfield.userid=user.userid;

Where fieldx is the new profilefield (eg. field10 for example) and oldfield is the name of the old field in table user.

Kohhal
01-30-2004, 07:28 AM
Thanks for the reply, looks easy in theory :)

Does it matter that the format of the fields are slightly different, the old field is varchar(50) and the new one varchar(250)?

/G