Replace the linefeed in the SQL field. Carriage Return:
In rich text content, carriage return and line feed are usually displayed. In the SQL database, the carriage return and line break are displayed as spaces after HTML is output.
This is found in data export and import. Generally, the carriage return and line break are found and replaced with <br>.
The SQL function is used here. Replace (string_expression, string_pattern, string_replacement), the first parameter: The field to be searched. Second parameter: the character to be searched. Third parameter: the character to be replaced.
Char (9) Horizontal tab char (10) line feed key char (13) Return key
1> carriage return char (13)
Select *, replace (detail, char (13), '<br>') as shows the replaced content from test
2> linefeed
Select *, replace (detail, char (10), '<br>') as shows the replaced content from test
3> enter a line break
Select *, replace (detail, char (13) + char (10), '<br>') as show the replaced content from test
4> Replace the carriage return with the line break <br>
Update Test
Set Detail = Replace (detail, char (13) + char (10), '<br> ')
Update t_news set content = Replace (content, char (13) + char (10), '<br>') Where news_type = 3
Add two spaces in front of the content, with the full width
Update t_news set content = ''+ content where news_type = 3