mysql and linebreaks

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ralle
Forum Commoner
Posts: 38
Joined: Mon Oct 17, 2005 5:05 am

mysql and linebreaks

Post 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)
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

What problems?

And are you trying to do an nl2br() ?
Ralle
Forum Commoner
Posts: 38
Joined: Mon Oct 17, 2005 5:05 am

Post 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
Ralle
Forum Commoner
Posts: 38
Joined: Mon Oct 17, 2005 5:05 am

Post by Ralle »

It's OK now, I used that code you just sent me :)
Post Reply