Frequently Asked Questions
Quick batch edit?
-
Quick batch edit?
Posted on May 21, 2004
Written by
Sasha (view more by Sasha)
Filed under FAQ, PHPFanBase: Customize, Scripts
Someone who has joined a bunch of my fanlistings changed their email/URL. Is there a fast way to go through the whole database and change their info?
You can go to phpMyAdmin and use UPDATE statements in MySQL, but it doesn’t work for an entire database, though, it’s only per table.
For someone who changed their email, you could use:
UPDATE table SET email = "newaddress@blog.com" WHERE email = "oldaddress@blog.com";
For someone who changed their url:
UPDATE table SET url = "http://newurl.com" WHERE url = "http://oldurl.com";
For someone who changed both email and url:
UPDATE table SET email = "newaddress@blog.com", url = "http://newurl.com" WHERE email = "oldaddress@blog.com" AND url = "http://oldurl.com";
You need to login to phpMyAdmin for this, and click the SQL tab. Just paste this directly into the text box, and of course, replace table and the email addresses/URLs with the right ones. You’ll have to do this for every fanlisting table, though.