View Full Version : Keep Formatting when adding to database

01-17-2008, 04:27 PM
Hi guys

Just a question about the format of data when input into a database.

I have a bit of script that allows people to place comments on my site, and i was wondering how do i make it keep the format that they enter it it, such as new lines, etc?

Because all the text comes out in one long line!

01-17-2008, 04:53 PM
Use nl2br(). But only use it when selecting/displaying data from the database; it's better to store the data without the br tags.

01-17-2008, 05:04 PM
Cheers man you are a star!!