How to Add A Line Break In MySQL?

Due to some legacy code, we have stored in our mySQL database line <BR> tags to designate line breaks. For example:

“I really like<br><br>SitePoint”

I’d like to replace these BR tags with visible line breaks, like:

"I really like

Site Point"

I’ve tried str_replace to
and \r
and various permutations thereof but when I put the text back in the database, it displays the
as text and doesn’t show the data as line breaked

Does anyone have any advice on creating true line breaks in mySQL?

use the CHAR() function, specifically CHAR(10,13) or CHAR(13,10) (i forget which is which and which comes first)

str_replace? why are you doing this in php? you can fix this directly in mysql like this:

update datable
   set dacolumn = replace(dacolumn, '<br>', '\
')

mysql will change the
into actual newlines.

oh, and the reason it didn’t work when you tried it before using str_replace is you probably used single quotes with the
.

Worked BEAUTIFULLY.

Thank you so much r937 and longneck, you’ve made my day.

Adam