Edit 1: this is not about LIMIT , this is about passing an integer. Other function that requires to pass numbers is IN
Edit 2: Should I use PDO::PARAM_INT ?
When I do this:
$query .= ' LIMIT ? , ? ';
$values [] = $offset ;
$values [] = $rows ;
At this line:
$db->fetchAll ( $query , $values);
Instead of execute:
SELECT ....... LIMIT 0 , 10;
It tries to execute:
SELECT ....... LIMIT '0' , '10';
Causing an error: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0' ,'10''
Note 1. I know that there is an option for limit in the $params array..
Note 2. There is a question related here
Note 3. I have tried: $values [] = intval($offset)
, $values [] = (int)$offset
, and even an integer like: $values [] = 10