Hello there im new in php, im trying to make a news plugin on my website. But i have following error which i cant get fixed.
$query = "SELECT `id` , `headline`, `timestamp` FROM `news` ORDER BY `timestamp` DESC";
$result = @mysql_query($query);
if(!$result){
echo('Error selecting news: ' . mysql_error());
exit();
}
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_object($result))
{
?>
<font size="-1"><b><? echo $row[headling]; ?></b> <i><? echo formatDate($row[timestamp]); ?></i></font><?
}
}
mysql_close($conn);
?>
Im geting same error over and over again.
Error: Error selecting news: No database selected