MSSQL Query results in no spacing

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
Randolph
Forum Newbie
Posts: 8
Joined: Mon May 22, 2006 7:26 am

MSSQL Query results in no spacing

Post by Randolph »

Hey guys and gals,

First post on devnet. w00t. Anyway, not sure if this is the right forum or not, but I have an issue I need help with.

I currently have a back-end admin setup to allow our Public Information Officer to post Press Releases to the website. On the backend, they can insert spaces (line returns) between paragraphs no problem. And when you go back to edit the same row, the spaces are still there.

Ok thats fine and all, except when I query the specific row and put it into a table, the spacing is not there. I know there has to be a way to do this, simply for the fact that I am doing it right now on phpBB.

I hope someone can help! Thanks!!! 8)
GM
Forum Contributor
Posts: 365
Joined: Wed Apr 26, 2006 4:19 am
Location: Italy

Post by GM »

What does the source of the HTML page look like?

Sounds to me like you probably need the "nl2br" PHP function, that turns all new lines into "<BR \>" HTML entities.
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Post by php3ch0 »

Randolph
Forum Newbie
Posts: 8
Joined: Mon May 22, 2006 7:26 am

Post by Randolph »

That function worked!!! Thanks a bunch.

http://www.marionso.com/mediarelease.php?id=89
Post Reply