|
|
include('navbar.php'); ?>
|
|
|
include('includes/dbconn.php'); ?>
Please select one of Bulletins below for more information... |
|
$sql1 = "SELECT * FROM categories ORDER BY category_name ASC";
$sqlresult1 = mysql_query($sql1);
while($record1 = mysql_fetch_array($sqlresult1, MYSQL_ASSOC))
{
$category_id=(int)$record1['id'];
$category_name=$record1['category_name'];
?>
$sql = "select * from bulletins WHERE bulletin_category_id=$category_id ORDER BY bulletin_date DESC";
$sqlresult = mysql_query($sql);
$rowcount=1;
while($record = mysql_fetch_array($sqlresult, MYSQL_ASSOC))
{
?>
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
$bulletin_date = date("Y-m-d",$record['bulletin_date']);
echo $bulletin_date;
?>
|
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
echo $record['bulletin_headline']; ?> |
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
view complete bulletin |
$rowcount=$rowcount + 1;
}
}
?>
// The list above only does bulletins that have category ids associated with them. Now we need to list all bulletins that do not have an associated category
$sql2 = "SELECT * FROM bulletins WHERE bulletin_category_id IS NULL ORDER BY bulletin_date DESC";
$sqlresult2 = mysql_query($sql2);
while($record2 = mysql_fetch_array($sqlresult2, MYSQL_ASSOC))
{
?>
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
$bulletin_date = date("Y-m-d",$record2['bulletin_date']);
echo $bulletin_date;
?>
|
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
echo $record2['bulletin_headline']; ?> |
if ($rowcount%2==0) {
?>
} else {
?> |
} ?>
view complete bulletin |
$rowcount=$rowcount + 1;
}
?>
mysql_close(); ?>
|
|
|
|
|