...

View Full Version : Keep Formatting when adding to database



adze
01-17-2008, 03: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!

Fumigator
01-17-2008, 03: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.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum