set_include_path("/home/eric627/includes/mikerickard.com"); ?>
include_once("mysql.inc"); ?>
$dbcnx = @mysql_connect($host,$user,$password);
if (!$dbcnx)
{
echo( "Unable to connect to the database server
");
exit();
}
// Select the database
if (! @mysql_select_db($database) )
{
echo( "Unable to locate headlines database
");
exit();
}
$count = 0;
$result = mysql_query( "SELECT *
FROM headlines
WHERE show_as_headline = 'Yes'
order by headline_date desc");
if ($result)
{
// display headlines in reverse order
while ($row = mysql_fetch_array($result) )
{
//show title and date
echo("" . $row["Title"] . "");
echo("
");
//show teaser text
echo($row["Teaser"]);
if (!(ctype_space($row["Body"]) or is_null($row["Body"])) and $row["Show_as_news"]=='Yes')
{
echo(" more...
");
}
else
{
echo(" ");
}
echo("
");
//show venue city/state
$count =+ 1;
}
// if none found, say so
if ($count == 0)
{
echo("No current news, check news page");
}
}
else
{
echo("Error getting t_headlines:
" . mysql_error() . "
");
exit();
}
?>