Replace command in mysql8/12/2023 ![]() ![]() This might not work for product descriptions in other complex CMS systems or whatever application it is. ![]() In my case, an old budgetless Prestashop installation, this dirty quick method does the job. A nice and easy way to replace a string using a query just like you would do it in a text editor with find and replace.Īnd I can’t stress this enough: be wary of what and where you replace so you don’t mess things up. ![]() In all fairness, you should really have a test installation or a backup so… yeah. Check it before you actually run the query. I know it’s logic, but it can be easily overlooked. Or else you’ll replace the HTTP part of a HTTPS link and you’ll end up with something like HTTPSS. Please note that in such scenarios, it is vital to also put those two dots… “:”. You can think about it like a phpMyAdmin find and replace. The above query will make all the links in the selected field go from HTTP to HTTPS. Your_table is your table’s name, your_field is the column name and the HTTP: and HTTPS: are the actual strings. SET your_field = REPLACE( your_field, ' HTTP:', ' HTTPS:') So the actual query we’re going to run is this: UPDATE your_table
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |