cancel
Showing results for 
Search instead for 
Did you mean: 

How do i insert line breaks in product description with a SQL query

How do i insert line breaks in product description with a SQL query

How can I replace (\n) in SQL with a Line Breaks? i want to do it with a SQL query,

I want in table: catalog_product_entity_text replace the value with Line Breaks instead of (\n)

2 REPLIES 2

Re: How do i insert line breaks in product description with a SQL query

Hello @iuvcureadhdc0c 

 

Use below query for can I replace (\n) in SQL with a Line Breaks:

 

UPDATE catalog_product_entity_text SET value = REPLACE(value, '\\n', CHAR(10)) WHERE value LIKE '%\\n%';

Hope it helps !

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

 

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

Re: How do i insert line breaks in product description with a SQL query

Try this query:-

replace \n with <br> like :- UPDATE catalog_product_entity_text SET value = REPLACE (value, '\n', '<br>');

use REPLACE() function
REPLACE(column_name, 'search_string', 'replace_string')

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.