Hi,
I was wondering if someone could explain something to me. I have a file called news.php:
news.php
PHP Code:
<?
$sql = "SELECT * FROM `p_news` ORDER BY `p_id` DESC";
$result = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_object($result))
{
$title = $row->p_title;
$content = $row->p_content;
}
?>
Then I have another file, index.php:
index.php
PHP Code:
<?
require ("./includes/db_con.php"); //connects to DB
require ("./includes/news.php");
echo $title;
echo "<br />";
echo $content;
echo "<br /><br />";
?>
My problem is, only the first row shows up, why is that, and how do I fix it?
Thanks in advance
Niklas