mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-24 05:01:23 +00:00
7915df0394
you'll need to send news updates to me for posting with MySQL.
24 lines
820 B
PHP
24 lines
820 B
PHP
<?
|
|
$conn = mysql_pconnect( "moby", "quakeforge", "6ef/HNvv" );
|
|
if ( $conn ) {
|
|
$query = 'SELECT n_date, n_user, n_news FROM news_main ' .
|
|
'ORDER BY n_date DESC';
|
|
$result = mysql_db_query( "quakeforge", $query, $conn );
|
|
if ( $result > 0 ) {
|
|
$numRows = mysql_num_rows( $result );
|
|
if ( $numRows > 0 ) {
|
|
for ( $i = 0 ; $i < $numRows ; $i++ ) {
|
|
list( $n_date, $n_user, $n_news ) = mysql_fetch_row( $result );
|
|
newsItem( $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!' );
|
|
}
|
|
$result = mysql_close( $conn );
|
|
} else {
|
|
newsItem( 'Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.' );
|
|
}
|
|
?>
|