require ("bb_news_config.inc");
mysql_connect($bb_news_hostname, $bb_news_mysqluser, $bb_news_mysqlpassword)
or die("Unable to connect to SQL server"); // We do this to handle the errors
// news is the name of the table
//
// We select only 5 of the latest records here, ordered by id number. You can change that
// to any number you would like or you can take it out all together
//
$query = "select id, subject, news, date_format(date, '%m/%d/%Y %h:%i %p') as date, author, link from news
order by id desc";
$news = mysql_db_query($bb_news_db, $query) or die("Select Failed!");
// We do this untill there is nothing left to do in the select statment.
//
while ($row = mysql_fetch_array($news)) {
// Formating is completly up to you. This is a sample.
//
// Color settings are in config.inc
//
?>
echo $row['date']; ?> echo $row['author']; ?> |