Skip to content

Instantly share code, notes, and snippets.

@vyspiansky
Created January 4, 2020 13:22
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vyspiansky/74431db45228b9d78990922e6395638d to your computer and use it in GitHub Desktop.
MySQL: replace <br> with <p>
# let's say we have an `article` table with `text` field
UPDATE `article` SET `text` = CONCAT('<p>', REPLACE(`text`, '<br>', '</p><p>'), '</p>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment