One of the best things about being a web programmer is that you get to share your knowledge with the programming community out there.
Today’s little snippet comes in the form of a simple Search and Replace for a string in PHPMyAdmin. Gone are the days where you needed to write a little script to handle the string replacement, it’s now as simple as the following.
We’ll use the example that a programmer needs to update the database table your_table_name, replacing all instances of his old domain name, domainone.com, with his new domain name, domaintwo.com
1. In PHPMyAdmin, click the Query tab.
2. In the Query box, submit the following query (make sure you back up the database or table before doing this).
UPDATE your_table_name SET your_table_name.column_name= REPLACE(your_table_name.column_name, "domainone.com", "domaintwo.com");
That’s it. Happy coding.
Leave A Comment