Your Right to Fish for Food
![Promote option4](../images/gr_promote.gif)
![Please help option4](../images/gr_support.gif)
| ![](../images/spacer.gif) |
![](../images/spacer.gif) |
$NUM_RECS = 10;
if (empty($lower)):
$lower = 1;
endif;
if (empty($offset)):
$offset = 0;
endif;
if (empty($upper)):
$upper = $NUM_RECS;
endif;
if(!empty($next_x)):
$lower += $NUM_RECS;
$upper += $NUM_RECS;
$offset += $NUM_RECS;
endif;
if(!empty($prev_x)):
$lower -= $NUM_RECS;
$upper -= $NUM_RECS;
$offset -= $NUM_RECS;
endif;
?>
This page contains comments from members of the public who felt strongly enough to put fingers to keyboard |
|
include("../includes/connect.php");
$cnt = $offset;
$query = "select id, name, comment, date from comments order by date desc ";
$countquery = $query;
$countresult = mysql_query($countquery, $db);
$numrows = mysql_num_rows($countresult);
$query .= " LIMIT $offset, $NUM_RECS" ;
$result = mysql_query($query, $db);
$errors = mysql_error();
if ($errors) {
echo $errors;
}
$upper = $offset + $NUM_RECS;
if($numrows <= $NUM_RECS):
echo "Displaying all " . $numrows;
else:
echo "Displaying recent comments " . $lower . " to " . ($upper > $numrows ? $numrows : $upper). " of " . $numrows." ";
if($lower != 1):
echo "« Previous $NUM_RECS ]";
endif;
echo " ";
if($upper < $numrows): /* Show the right arrow and text */
echo "[Next $NUM_RECS »";
endif;
endif;
?>
|
while(list($id, $name, $comment, $date) = mysql_fetch_row($result)) {
$monthq = mysql_query("select DATE_FORMAT('$date','%M')");
$month = mysql_fetch_array($monthq);
$dayq = mysql_query("select DATE_FORMAT('$date','%e')");
$day = mysql_fetch_array($dayq);
$yearq = mysql_query("select DATE_FORMAT('$date','%Y')");
$year = mysql_fetch_array($yearq);
$datestr = $day[0]." ".$month[0]." ".$year[0];
print(" | $comment ....$name ($datestr) | ");
}
?>
if($numrows <= $NUM_RECS):
echo "Displaying all " . $numrows;
else:
echo "Displaying comments " . $lower . " to " . ($upper > $numrows ? $numrows : $upper). " of " . $numrows." ";
if($lower != 1):
echo "« Previous $NUM_RECS ]";
endif;
echo " ";
if($upper < $numrows): /* Show the right arrow and text */
echo "[Next $NUM_RECS »";
endif;
endif;
?>
|
|