// includes include("inc/functions.php"); // generate and execute query $query = "SELECT id, pubdate, headline, title, binaryref, body, byline, status, caption FROM heathen WHERE status = 1 && free = 1 ORDER BY pubdate DESC"; run_query($query); $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error()); // if records present if (mysql_num_rows($result) > 0) { // iterate through resultset // print article titles $cnt = 1; while($row = mysql_fetch_object($result)){ if (is_int($cnt/2)){ $bgcol = "#EDBF9B"; }else{ $bgcol = "#FFD49F"; } $cnt++; ?>
echo formatDate($row->pubdate); ?>
NEWS:
echo $row->headline; ?>
if ($row->binaryref == "0") { print("
"); }else{ printf("
", $row->binaryref);} ?>
echo $row->caption; ?>
echo $row->title; ?>
echo $row->body; ?>
echo $row->byline; ?>
} } // if no records present // display message else { ?>
there is currently no news available
} ?>
include ("redsherrif_site.inc"); ?>