How to remove double slashes from column in MySQL?
I have recently found a bug in my website that has been inserting an extra backslash in the URL. I have fixed the bug, but would like to clean up my historical data.
My table name is
visits and column name is
url. Some of the example URLs in the field are:
www.mysite.com// www.mysite.com//restaurant/mcdonalds/ www.example.com//
How can I do a find and replace on
// to change it to
/ in MySQL?
I would greatly appreciate any help. Thanks!
update visits set url=replace(url, '//', '/');
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]