Hi,
I have a form with a <textarea> field for people to put in their comment. People can type in “new line” to the textarea field by just pressing the “enter” button on the keyboard. I want to know how I can store the comment WITH the “new line” information to the sql server by a insert statement like this:
INSERT INTO Comment (id, comment) VALUES(NEWID(), $_POST[‘comment’])
Will the above statement store the “new line” information into the database? What character exactly is stored in the MSSQL database for a “new line”? I checked lots of places online and it seems that MSSQL doesn’t recognize ‘rn’ as new line.
Also, when I retrieve some information containing “new line” from the database by a select statement, how do I get the “new line” printed as a real new line on the webpage? Because echo ‘rn’ won’t result in a new line on the webpage, only “<br>” does.
I’m not asking for everything without doing my own thinking. All I need is a tip and I can figure the remaining answers out later by myself. Thank you everyone for any advice or tips.