Re: Content Feed

From: Date: Mon, 21 Oct 2002 15:54:34 +0000
Subject: Re: Content Feed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120759@lists.php.net to get a copy of this message
You are looking for nl2br() http://www.php.net/nl2br Try this printf nl2br("<tr><td>%s</td></tr>", $row[2]); > } --- php@erars.demon.co.uk wrote: > I have developed my own content feed in that you > enter an article from somewhere which is posted into > a mysql database and then anyone with access to it > can use a java call to the feed and have the > neadlines of the the most recent news articles > displayed on their web site. > > When you click on a headline it refers to an ID in > the news table and a new window is opened and the > article is displayed but without any formatting at > all. > > When an article is entered people may press enter to > separate paragraphs etc and would like to know how > to get these spaces to be reciprocated when the > article is displayed as currently it ommits the > breaks. > > This is the code which I currently have in place: > > <?php > > mysql_connect ("localhost", "root","testhouse"); > > mysql_select_db ("content"); > > > > $result = mysql_query ("select * FROM articles WHERE > articleId='$articleId'"); > > while ($row = mysql_fetch_row($result)) > { > > printf ("<tr><td>%s</td></tr>", > $row[2]); > } > > ?> > > I presume I need to insert something in the printf > section, although it might be something to do with > the code that inserts it into the database not being > able to handle breaks. > > Any help and direction would be much appreciated. > > thanks > > JCook > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/

« previous php.general (#120759) next »