This is my code
$PageNumber = $_GET["p"];
if (!isset($PageNumber) || $PageNumber < 1 || !is_int($PageNumber))
$PageNumber = 1;
$PageSize = 3;
$strSQL = $dbCon->prepare("SELECT * FROM News WHERE isActive = 1 ORDER BY NewsID DESC LIMIT (:PageNumber - 1)*:PageSize, :PageSize;");
$strSQL->bindParam(":PageNumber", $PageNumber, PDO::PARAM_INT);
$strSQL->bindParam(":PageSize", $PageSize, PDO::PARAM_INT);
$strSQL->execute();
$Result = $strSQL->fetchAll();
if (count($Result) != 0) {
print_r($Result);
} else {
echo "no record";
}
im sure rows exist but output is no record
, When i replace parameters with default value like LIMIT 0,3
it works well.