pagination
Posted: Wed Apr 18, 2012 3:17 am
Hi all,
i have implemented php pagination to my work..it works fine, BUT only when i have NO CONDITIONS to my if-statements; in other words the problem arises when i click on the NEXT or BACK button; the sql being executed after clicking these buttons is the initial sql; i.e the sql outside of the if-statement
the following code is a sample:
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$clinicName = $_POST['clinic'];
$fromDate = $_POST['fromDate'];
$toDate = $_POST['toDate'];
}
require("initialVariables.php"); //INITIAL SQL
if($clinicName == "IDCC" AND ($fromDate == "" AND $toDate == ""))
{
require("allIDCC.php"); //CONDITION SQL
}
i have implemented php pagination to my work..it works fine, BUT only when i have NO CONDITIONS to my if-statements; in other words the problem arises when i click on the NEXT or BACK button; the sql being executed after clicking these buttons is the initial sql; i.e the sql outside of the if-statement
the following code is a sample:
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$clinicName = $_POST['clinic'];
$fromDate = $_POST['fromDate'];
$toDate = $_POST['toDate'];
}
require("initialVariables.php"); //INITIAL SQL
if($clinicName == "IDCC" AND ($fromDate == "" AND $toDate == ""))
{
require("allIDCC.php"); //CONDITION SQL
}