sql - mysql wildcard (ignore one/two characters in search) -


I am trying to update the tables in my WordPress MU database, I want to update all the wp_options tables, this table The following are:

  • wp_1_options
  • wp_2_options
  • ... and so on.

How do I affect all tables with wp_any-character-here_options? I tried to query for:

  UPDATE wp _% _ option SET option_value = replace (according to option_and 'http://www.old-domain.com', 'http : //www.new- Domain.com ') WHERE option_name =' home 'or option_name =' siteurl ';  

... but mysql complains that I have an error in syntax ...

You can not make a wildcard UPDATE statement - You must type a UPDATE statement for each table.

Unchecked:

  Start the cleaning process () I def DEFAULT 1; Prepare STMT before "Update" SET option_value = REPLACE (option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name IN ('home' , 'Cyclical') "WHILE i & lt; = 10 EXCUTE STMT USING CONCAT ('wp_', i, '_options'); set I = I + 1; Finally; DEALLOCATE STMT; Finished;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -