|
![](images/shim.gif) |
Support
Comments
|
|
This
page contains comments from members of the public who felt strongly
enough to put fingers to keyboard |
|
|
|
$db = mysql_connect("127.0.0.1", "option4", "yW3xbwp8K"); //Give us permission to write to the database
mysql_select_db("option4",$db);
$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;
?>
|
|
|
|
|