Quoting Elliott F. Cable, from the post of Mon, 15 May:
Any tips on checking for usernames? A script in the
maintenance dir
for combining two user databases would be cool (-:
there are a few nice ways to do it right there in SQL (which is always
good to know, it's a pretty simple, thought powerful, language). if you
want the quickest way for you to chop up tables and search for doubles,
without learning SQL, I suggest you dump the two tables to CSV and use
your favorite text manipulation tools like sort, uniq, awk, whichever is
your favorite. there are of course countless ways to do such an export.
a quick google on "mysql export csv" returns code to do it in php and
SQL alike.
What about for the other tables in his install? They'll need to be
updated to use the new user IDs too )-]
same commandline, different table...
> Do yourself a favor and skip the PHP; this is
what SQL was made
> for. :)
>
> UPDATE mytable SET mytable_user=mytable_user+402;
>
> or to avoid breaking anonymous & scripted edits something like this
> should work:
>
> UPDATE mytable SET mytable_user=IF(mytable_user,mytable_user+402,0);
>
don't fear SQL, it's your friend :)
--
FCC restricted word
Ira Abramov
http://ira.abramov.org/email/