Hmm, ok well the problem is, being a non-PHP person I have no clue how to decipher the code DW has already written in order to know where to put this code :-( I must admit to not knowing PHP and understand if you don't want to deal with a newbie, LOL. But here's the code of the page...
<?php require_once('Connections/Zeus.php'); ?>
<?php
$currentPage = $HTTP_SERVER_VARS["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($HTTP_GET_VARS['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $HTTP_GET_VARS['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$varClass_Recordset1 = "%";
if (isset($HTTP_GET_VARS['selectClass'])) {
$varClass_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['selectClass'] : addslashes($HTTP_GET_VARS['selectClass']);
}
$varEnd_Recordset1 = "%";
if (isset($HTTP_GET_VARS['endRange'])) {
$varEnd_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['endRange'] : addslashes($HTTP_GET_VARS['endRange']);
}
$varStart_Recordset1 = "%";
if (isset($HTTP_GET_VARS['startRange'])) {
$varStart_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['startRange'] : addslashes($HTTP_GET_VARS['startRange']);
}
$varIntroBody_Recordset1 = "%";
if (isset($HTTP_GET_VARS['IntroBody'])) {
$varIntroBody_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['IntroBody'] : addslashes($HTTP_GET_VARS['IntroBody']);
}
$varSort_Recordset1 = "%";
if (isset($HTTP_GET_VARS['sort'])) {
$varSort_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['sort'] : addslashes($HTTP_GET_VARS['sort']);
}
$varKey_Recordset1 = "%";
if (isset($HTTP_GET_VARS['searchKey'])) {
$varKey_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['searchKey'] : addslashes($HTTP_GET_VARS['searchKey']);
}
mysql_select_db($database_Zeus, $Zeus);
$query_Recordset1 = sprintf("SELECT stories.intro, stories.ts, stories.aid, stories.body, stories.did, deptClass.deptname, deptClass.did, deptClass.class FROM stories, deptClass WHERE stories.did = deptClass.did AND %s LIKE '%%%s%%' AND deptClass.class LIKE '%s' AND stories.ts >= '%s' AND stories.ts <= '%s' ORDER BY stories.ts %s", $varIntroBody_Recordset1,$varKey_Recordset1,$varClass_Recordset1,$varStart_Recordset1,$varEnd_Recordset1,$varSort_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $Zeus) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($HTTP_GET_VARS['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $HTTP_GET_VARS['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<table width="100%" border="1" cellspacing="3" cellpadding="3">
<tr>
<td width="46%"><strong>Headline</strong></td>
<td width="26%"><strong>Dept</strong></td>
<td width="28%"><strong>Date</strong></td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['intro']; ?> >> <a href="http://talk.trekweb.com/cgi-bin/comments.pl?aid=<?php echo $row_Recordset1['aid']; ?>">Select</a></td>
<td><?php echo $row_Recordset1['deptname']; ?></td>
<td><?php echo $row_Recordset1['ts']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<p> Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?></p>
<p>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
<?php } // Show if not first page ?> </td>
<td width="31%" align="center"> <?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
<?php } // Show if not first page ?> </td>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
<?php } // Show if not last page ?> </td>
<td width="23%" align="center"> <?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
<?php } // Show if not last page ?> </td>
</tr>
</table></p>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Incidentially, you wouldn't know a good PHP book that would be good for a newbie to PHP? I'm not looking to be an expert on it, but some basic understanding so I could do things like this would be nice. LOL