//////////////////////////////////////////////////////////////////////////////////////////
// //
// BlueBoy Whats New APP v. 1.0.3 //
// by Mike Norton //
// mike@blueboy.cx http://www.blueboymultimedia.com //
// //
// You may use this to your hearts content. It is Open Source :-) //
// //
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
// //
// Create your table by running this SQL statment in MySQL: //
//--------------------------------------------------------------------------------------//
// //
// CREATE TABLE news ( //
// id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, //
// subject varchar(50) NOT NULL, //
// news blob NOT NULL, //
// date datetime DEFAULT '0000-00-00' NOT NULL, //
// author varchar(50) NOT NULL, //
// link varchar(150), //
// PRIMARY KEY (id) //
// );
//
// You may also run the bb_news.mysql file to create the database. //
// //
//////////////////////////////////////////////////////////////////////////////////////////
/// MAIN APP /////////////
// Database entry points. Gets all info from config.inc
//
require ("admindocs/bb-news/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 limit 5";
$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']; ?> by echo $row['author']; ?>
echo $row['subject']; ?>
echo $row['news']; ?>
echo $row['link']; ?>
// Now we are done. Simple call this file from within your php3 app useing
// require ("admindocs/bb-news/bb_news.php3"); in your code. Dont forget to include the open and close php
} ?>