01-06-2014, 12:17 AM #1WHT Addict
- Join Date
- May 2004
Do a SQL server wide UPDATE for all tables?
Does anyone know if its possible to:
1) Search for all tables ending with the name ending with "_users" under all databases (executed by the root user in phpmyadmin)
2) In this list of tables, search for all records where the field user_login = "xyz"
3) UPDATE these records, set the user_login field to be = user_nicename field and set the user_pass = MD5('abcxyz')
Kristy"The problem with me & French is, you only say half the letters and I never know which half."
01-06-2014, 12:36 AM #2Web Hosting Master
- Join Date
- Dec 2003
Since your WHERE condition is always same
SET user_login field = user_nicename, user_pass = MD5("abcxyz") WHERE user_login = "xyz"
SELECT CONCAT( 'UPDATE ' , table_name,' SET user_login = user_nicename, user_pass = MD5("abcxyz") WHERE user_login = "xyz"' ) FROM information_schema.tables WHERE table_name LIKE '%_user';Primary email: advanced dot programmer at gmail dot com ..
By jonessc in forum Design RequestsReplies: 5Last Post: 03-29-2012, 01:31 PM
By jjk2 in forum Programming DiscussionReplies: 3Last Post: 04-08-2009, 03:11 PM
By cfaice in forum Hosting Security and TechnologyReplies: 14Last Post: 01-01-2006, 01:05 PM
By ChrisF79 in forum Programming DiscussionReplies: 4Last Post: 11-01-2005, 06:46 AM
By spiceman in forum Web Hosting LoungeReplies: 0Last Post: 01-21-2002, 09:49 PM