$connection=mysql_connect('localhost', 'mcnabb', 'WebBobIce');
if (!$connection) {
die ("Could not connect to the database: ". mysql_error());
}
$db='glaciers';
$db_select=mysql_select_db($db);
if (!$db_select) {
die ("Could not select the databse: ". mysql_error());
}
$statement="SELECT DISTINCT year FROM group_citations ORDER BY year DESC";
$sth=mysql_query($statement);
?>
Recent Publications
while ( $row = mysql_fetch_assoc( $sth ) ) {
$year = mysql_real_escape_string($row['year']);
$year_query = "SELECT * FROM group_citations WHERE year= $year ORDER BY authors";
$year_result = mysql_query($year_query);
?> display_year($year) ?>
while ( $year_result_row = mysql_fetch_assoc( $year_result ) ) {
?>
.
if ( 9999 == $year ) {?>
.
} else {?> ().}?>
. ,
if ( $year_result_row['volume'] != 'NULL' ) {?>
} else {?> }
if ( $year_result_row['number'] != 'NULL' ) {?>
()
} else {?> }
if ( $year_result_row['note'] != 'NULL' ) {?>
, .
}
else {?>
}
}
}
mysql_close($connection);
#-------------------------------------------------------------------------------------------------------------------
# subroutines
#-------------------------------------------------------------------------------------------------------------------
function display_year( $year ) {
switch ( $year ) {
case 9999:
echo "In Press";
break;
default:
echo $year;
}
}
?>
|