Practitioners are Listed Below
Select a Country from the directory drop down list to View Members in that Country:"; include ('http://www.advancedclearingenergetics.com/country.php'); echo "
";
//Here we count the number of results $result = mysql_query("SELECT * FROM user WHERE country = '$country' AND `active` = 1 ") or die(mysql_error()); $rows = mysql_num_rows($result);
//This checks to see if there is a page number. If not, it will set it to page 1 if (!(isset($pagenum))) { $pagenum = 1; } echo "Page" . " " . $pagenum . "";
if (empty($country)) { echo " You must select a Country from the drop down menu above to view listings"; }
//This is the number of results displayed per page $page_rows = 24;
//This tells us the page number of our last page $last = ceil($rows/$page_rows); $thispage = $pagenum; $one = 1; $toplimit = $thispage - $one;
//this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; }
//This sets the range to display in our query $max = "LIMIT" . " " . ($toplimit * $page_rows) . "," . $page_rows;
//This is your query again, the same one... the only difference is we add $max into it $result = mysql_query("SELECT * FROM `user` WHERE country = '$country' AND active = '1' ORDER BY city ASC $max") or die(mysql_error());
echo "
//This is where you display your query results while($row = mysql_fetch_array($result)) {
echo $row['Company'] . ""; echo $row['firstName'] . " " . $row['lastName'] . ""; echo "" . $row['website'] . ""; echo "Location:" . " " . $row['city'] . "," .$row['state'] . "," . $row['country'] . ""; echo "Background/Occupation:"; echo $row['therapies'] . ""; echo "Email " . $row['firstName'] . ""; echo ""; echo "
} echo "
// This shows the user what page they are on, and the total number of pages echo " --Page $pagenum of $last--
// First we check if we are on page one. If we are then we don't need a link to the previous page or the first page so we do nothing. If we aren't then we generate links to the first page, and to the previous page. if ($pagenum == 1) { } else { echo " <<-First "; echo " "; $previous = $pagenum-1; echo " <-Previous "; }
//This does the same as above, only checking if we are on the last page, and then generating the Next and Last links if ($pagenum == $last) { } else { $next = $pagenum+1; echo " Next -> "; echo " "; echo " Last ->> "; }
?>