ok
this is what i what to place into another place
<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"100%\">$row->title</td>
</tr>
<tr>
<td width=\"100%\">$row->content</td>
</tr>
<tr>
<td width=\"100%\">Posted by <a href=\"mailto:$row->authermail\">$row->auther</a></td>
</tr>
</table><br>
it is called from conf.php but i want it displayed in index.php
but also i want the $row->##### bits to display the data from the mySQL query in index.php
<?
require("conf.php");
//code to diplay news items
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "SELECT id, title, content, auther, authermail FROM news ORDER BY id ASC LIMIT 0,15";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0)
{
// iterate through resultset
// print article titles
while($row = mysql_fetch_object($result))
{//this is the code that formats the news (edit the HTML only))
//THIS IS WHERE THE CODE NEEDS TO BE DISPLAYED
}
}
// if no records present
// display message
else
{
echo "No news Present";
}
// close database connection
mysql_close($connection);
?>
i hope that explains it