Log in

View Full Version : PHP/MySQL Question


mtc
27th May 2003, 09:34
Hi,

I'm trying to write my first PHP script. It is a simple script to let visitors to the site add a story/news etc to the site.

It seems to be working perfectly except that the body of the story item is displaying without any carriage returns - they are getting lost somewhere between getting put into the database (where they are stored in longtext format) and getting printed out again.

Does anyone know how I can keep my carriage returns?

Thanks

Chris

mpucoder
27th May 2003, 09:39
Never wanted to do this myself, but you could try http://us4.php.net/manual/en/function.nl2br.php

mtc
27th May 2003, 09:53
That was exactly what I wanted.
Worked great.

Thank you very much :)