Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 25-01-07
Kandevil's Avatar
Ian Ebbs
 
Join Date: Aug 2003
Location: England
Posts: 1,065
Thanks: 0
Thanked 0 Times in 0 Posts
Kandevil is an unknown quantity at this point
  Question PHP/mysql formating problem with paragraphs

I have some text stored in a mysql database, it is actually some content from a wordpress post that I want to manipulate.

In wordpress the text appears on the postings page as

Quote:
Text text text text text, text text. Text text text text text, text text

Text text text text text, text text. Text text text text text, text text, Text text text text text, text text.
which is how I want it, but when I use PHP to select the details from the database and put it in a variable, that I then echo, I end up with:

Quote:
Text text text text text, text text. Text text text text text, text text Text text text text text, text text. Text text text text text, text text, Text text text text text, text text.
so it loses the line breaks, what do I need to do with PHP to maintain the line breaks or to code them into what is put in the variable.

Anyone got any ideas? Much appreciated.
__________________

affiliates4u Fantasy Football Winner 2007/08
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 25-01-07
Chris Clarkson's Avatar
PHP never lies...
 
Join Date: Jul 2003
Location: Glasgow
Posts: 595
Thanks: 0
Thanked 1 Time in 1 Post
Chris Clarkson is an unknown quantity at this point
  Re: PHP/mysql formating problem with paragraphs

Hi,

nl2br($text) should do it!

Chris C
__________________
sunshine.co.uk - Cheap Holidays, Hotels and Flights on Affiliate Future
email: chris.c [at] sunshine.co.uk
Affiliate Area
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 25-01-07
Kandevil's Avatar
Ian Ebbs
 
Join Date: Aug 2003
Location: England
Posts: 1,065
Thanks: 0
Thanked 0 Times in 0 Posts
Kandevil is an unknown quantity at this point
  Re: PHP/mysql formating problem with paragraphs

quality thanks Chris & Ste

using echo nl2br($yourvariablename);

works a treat !
__________________

affiliates4u Fantasy Football Winner 2007/08
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Picture Loans Problem - OMG Problem Black Cat OMGUK.com, Online Media Group 9 25-01-07 09:12 PM
Problem with DGM2 links to migrated programs Rich DGM Affiliates 21 21-10-05 12:52 PM
My problem frazer987 The Affiliate Marketing Lounge 5 25-06-05 11:02 AM
php/mysql insert problem drivetowin Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 3 25-09-04 08:38 AM
Real Beer - sales tracking problem tobyt Affiliate Window 4 13-02-04 09:25 AM


Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7