Click to See Complete Forum and Search --> : MySQL Append + Carriage Return


Phill Pafford
10-06-2006, 04:48 PM
Hi all, I have a popup screen which information gets appanded to a record, this works great. The question I have is how do I add a carriage return to the value?

Example:

initial value = "test data"

updated value = "test data updated data"

how to I get it to insert a carriage return so the updated data will look like this:

updated value = "test data
updated data"



UPDATE table_name SET column = CONCAT(column, '$new_value') WHERE another_column=$PK";


I can manually push the enter key to get the data to format the way I want it to, but is there a way that i could do this in my statement?

chazzy
10-06-2006, 04:57 PM
\n is the typical carriage return character.

CONCAT(column,'\n $newvalue')

Phill Pafford
10-16-2006, 02:47 PM
Thanks that did the trick, I was trying to use <br>