Content Feed
| From: | php at erars dot demon dot co dot uk | Date: | Mon, 21 Oct 2002 15:22:26 +0000 |
| Subject: | Content Feed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-120748@lists.php.net to get a copy of this message | ||
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