website/old_news.php

27 lines
813 B
PHP
Raw Normal View History

2000-03-20 05:30:19 +00:00
<?
need ('date sql');
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
' ORDER BY n_date DESC';
$result = mysql_db_query (sqlDB, $query, $conn);
if ($result) {
$numRows = mysql_num_rows ($result);
if ($numRows) {
for ($i = 0 ; $i < $numRows ; $i++) {
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
newsItem (dateFromSQLDateTime ($n_date), $n_user, $n_news);
}
} else {
newsItem ('now', 'Web Server', '<P>No current news!');
}
} else {
newsItem ('now', 'Web Server', '<P>No news in database!');
}
mysql_close ($conn);
} else {
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
}
2000-03-20 05:30:19 +00:00
?>