I am doing the following query. If i put the numbers straight into the query the query returns lots of results... Now if I use the bindParam to pass the values there are no results.
I've tested whether or not the passed values have values and the echo shows that they do... so I have no idea why this is happening
Could anyone tell me what am i doing wrong?
public function searchWithPagination( $startPage = 0, $numberResultsPerPage = 10 ) {
$q = $this->db->prepare( 'SELECT * FROM ecm LIMIT :startpage, :numberresultsperpage' );
$q->bindParam(':startpage', $startPage);
$q->bindParam(':numberresultsperpage', $numberResultsPerPage);
$q->execute();
echo $numberResultsPerPage . $startPage ;
$f = $q->fetchAll();
var_dump($f);
}
EDIT: tried PDO::PARAM_INT
still doesnt work