Also you can use: REPLACE(`col_name`,"\n","") as `col_name` You must use this after SELECT. Example code: SELECT *, REPLACE(`name`,"\n","") as `name` FROM xyz WHERE id="%s"
REPLACE(`col_name`,"\n","") as `col_name`
SELECT
SELECT *, REPLACE(`name`,"\n","") as `name` FROM xyz WHERE id="%s"