Hello Guys, As you can see our website http://www.lindseyinteractive.com we have our phone number on several different pages, these are all using Wordpress and are in a database. However, we have just changed our phone number, so is there a way to run a SQL commend to replace the phone number we have on there with a new one? Thanks in advance.
Well , you can change the phone numbers in one go via Update query . You need to define your table name and field name and run the query. Google it and you can do it with ease.
if your number is on a PAGE, chances are it is in a flat file on the server and you can do a simple text find and replace - or is your number listed on individual posts?
You're going to want to refer to MySQL's REPLACE function to accomplish that (http://dev.mysql.com/doc/refman/5.0/en/replace.html). Some SQL like this will do the trick: UPDATE table_name SET your_field = REPLACE(your_field, 'old-phone-number', 'new-phone-number') WHERE your_field LIKE '%old-phone-number%' Code (markup): Obviously you would need to modify that to use the correct table, fields and phone numbers for your particular case. Hope that helps!
You will need to use regex and run some kind of edit tool. Maybe it is possible to do with SQL, but you will need to use a code that will read a text and change number. How will i do it: i m not into SQL and MYSQL but i can code a bot that will read all pages and if he finds old number he remembers a page. After i collect all pages i will edit them and replace old number with new number. Ofcourse this method cost money. SQL method: I m not expert and i cant give you code. But you will need to run a search for a text that contains number, that can easy be done, even i can do this. But hard way is how to make a replace. How to replace old text, extract number and change it with new number. Is it even possible?
Simple solution: download a backup of the database (the SQL-file), open it in a decent text-editor, and search/replace all instances of the phone-number. Upload back to the site.
That will work only if the database is small. There is no way he will open any larger database in txt editor. And i think that is anything above 50mb?