2 function show_news($limit=5) {
3 global $db_name,$db_handle;
5 $query = "SELECT * from news ORDER BY id desc LIMIT $limit";
6 $result = mysql_db_query($db_name,$query,$db_handle);
8 while($news = mysql_fetch_array($result))
11 box_start($news["title"],date("F d, Y",$news["timestamp"])." <br>Posted by ".$news["author"],"90%");
12 echo $news["message"];
17 function add_news($author,$title,$message) {
18 global $db_name,$db_handle;
21 $query = "INSERT INTO news (timestamp,title,author,message) VALUES ('$timestamp','$title','$author','$message')";
22 $result = mysql_db_query($db_name,$query,$db_handle);
24 print("MySQL Error: " . mysql_error());