some of the code that im using is as following, as you can see the select statment come twice:
$numresults = mysql_query("select * from jobs where (job_title OR job_summary) LIKE '%$POST[keyword]%' AND job_sector = '$POST[job_sector]' AND region = '$_POST[region]';"); // the query.
$numrows = mysql_num_rows($numresults); // Number of rows returned from above query.
$pages = intval($numrows/$limit); // Number of results pages.
// $pages now contains int of pages, unless there is a remainder from division.
if ($numrows % $limit) {
$pages++;} // has remainder so add one page
$current = ($page/$limit) + 1; // Current page number.
if (($pages < 1) || ($pages == 0)) {
$total = 1;} // If $pages is less than one or equal to 0, total pages is 1.
else {
$total = $pages;} // Else total pages is $pages value.
$first = $page + 1; // The first result.
if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) {
$last = $page + $limit;} //If not last results page, last result equals $page plus $limit.
else{
$last = $numrows;} // If last results page, last result equals total number of results.
$job_id = $GET['job_id'];
$query = "select * from jobs where (job_title OR job_summary) LIKE '%$POST[keyword]%' AND job_sector = '$POST[job_sector]' AND region = '$POST[region]';";
the code is some pagination ive set up along with the sql statments. Can anyone help