News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SQL QUERY to update members needed

Started by The One, July 08, 2006, 04:37:16 AM

Previous topic - Next topic

The One

I am standardizing the names of the members (accorindg to their newtwork ids) in my LAN and have asked them to use those names when they signup.
The problem is my old members will now be considered new (as I will be deleting their old ids).

If anyone has a query that I can use to get their old posts to be linked to theri new ID's that would be great?
The problem is choice

Rudolf

The basic query would be:
UPDATE smf_messages SET ID_MEMBER = {$new_memberID} WHERE ID_MEMBER = {$old_memberID}

If you need to update the names and emails too then add in the before the WHERE , posterName = '{$new_memberName}', posterEmail = '{$new_memberEmail}'
Replace the {$new_memberID}, ${$old_memberID} etc. with the actual values.
You can run the query in phpMyAdmin, or if you have lots of users a small script would do.
Backup your database before starting to mess with it.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Advertisement: