please see http://doktorko.com/searchTest.php, fill in a field on the form, and test the search. on the result page, click on a number navigation. that\'s where my problem is. here\'s the result.php code (i used some codes suggested earlier):
<head>
<title>Untitled Document</title>
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<table width=\"566\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"566\" height=\"408\" valign=\"top\"> <?
$connection = mysql_connect(\"localhost\", \"user\", \"pwd\") or die (\"Couldn\'t connect to database\");
$db = mysql_select_db(\"myDB\", $connection) or die (\"Couldn\'t select DB\");
$where = \'\';
if ($lname == \"\")
{$lname=\'%\';}
if ($lname) {
$where = \"where lower(lname) like lower(\\"%$lname%\\")\";
}
if ($school==\"NULL\")
{$school=\'%\';}
if ($school) {
if ($where) {
$where = $where .
\" and lower(school) like lower(\\"%$school%\\")\";
} else {
$where = \"where lower(school) like lower(\\"%$school%\\")\";
}
}
if ($specialty ==\"NULL\")
{$specialty= \'%\';}
if ($specialty) {
if ($where) {
$where = $where . \" and lower(specialty) like lower(\\"%$specialty%\\")\";
} else {
$where = \"where lower(specialty) like lower(\\"%$specialty%\\")\";
}
}
if ($country ==\"NULL\")
{$country=\'%\';}
if ($country) {
if ($where) {
$where = $where .
\" and lower(country) like lower(\\"%$country%\\")\";
} else {
$where =
\"where lower(country) like lower(\\"%$country%\\")\";
}
}
$limit = 5;
$sqlcount= \"SELECT * FROM table $where \";
$sql_countresult = mysql_query($sqlcount, $connection) or die (\"Couldn\'t execute query 1\");
$totalrows = mysql_num_rows($sql_countresult);
if(empty($page)){
$page = 1;
}
$limitvalue1 = $page$limit-($limit);
$sql = \"SELECT FROM table $where LIMIT $limitvalue1, $limit\";
$sql_result = mysql_query($sql, $connection) or die (\"Couldn\'t execute query 2\");
echo \"<p>$totalrows entries selected</p>\n\";
while ($row = mysql_fetch_array($sql_result)){
$physician_id=$row[user_id];
echo \"<a href=\\"search2.php?user_id=$row[user_id]\\"
target=\\"search2\\">\";
print $row [lname];
print \", \";
print $row [fname];
print \" \";
print $row [mname];
print \"</a>\";
print \"<br>\";
print \"Medical School:\"; print (\" \");
print $row [school]; print \"<br>\";
print \"Specialty:\"; print (\" \");
print $row [specialty]; print \"<br>\";
print \"Office location:\"; print (\" \");
print $row [country]; print (\"<br>\");
echo \"Email address:\";
print \"<a href=\\"mailto: $row[email]\\">\";
print $row [email];
print \"</a>\";
print \"<p>\";
}
echo \"<BR>\";
if($page != 1) {
$pageprev= $page - 1;
echo \"<A HREF=\\"$PHP_SELF?showrecord=enter&page=$pageprev\\"> PREV </A>\"; // if page is not equal to one, prev goes to $page - 1
}
else if ($page = 1){
}
else
{
}
$numofpages = $totalrows/$limit;
for($i= 1; $i < $numofpages; $i++) {
echo \"<A HREF=\\"$PHP_SELF?page=$i\\"> $i </A>\"; //make number navigation
}
if($totalrows%$limit != 0) {
echo \"<A HREF=\\"$PHP_SELF?page=$i\\"> $i </A>\"; ////if there is a remainder, add another page
}
if(($totalrows-($limit$page)) > 0){
$pagenext = $page + 1;
echo \"<A HREF=\\"$PHP_SELF?page=$pagenext\\"> NEXT </A>\"; // if the totalrows - $limit $page is > 0 (meaning there is a remainder), leave the next button.
}
?>
</td>
</tr>
<tr>
<td height=\"37\"></td>
</tr>
</table>
</body>
thanks so much for the help.
manny