Page 1 of 1

mysql and linebreaks

Posted: Thu Oct 27, 2005 9:38 am
by Ralle
I am getting problems with trying to use the function str_replace with data from a mysql database.

here is the following code:

Code: Select all

$desc = str_replace ('%0D', '<br>', $row['maps_desc'] );
the $row['maps_desc'] is data directly taken from the database and is a TEXT type (taken from texarea)

Posted: Thu Oct 27, 2005 9:44 am
by Grim...
What problems?

And are you trying to do an nl2br() ?

Posted: Thu Oct 27, 2005 2:02 pm
by Ralle
this line makes my script unfunctional. I don't know why.. the line is just an ordinary textarea string.. But what I want is to make the linebreaks from data from a database

Posted: Thu Oct 27, 2005 2:08 pm
by Ralle
It's OK now, I used that code you just sent me :)