php - How to pass an integer to a query in CakePHP? -
edit 1: not limit , passing integer. other function requires pass numbers in
edit 2: should use pdo::param_int ?
when this:
$query .= ' limit ? , ? '; $values [] = $offset ; $values [] = $rows ;
at line:
$db->fetchall ( $query , $values);
instead of execute:
select ....... limit 0 , 10;
it tries execute:
select ....... limit '0' , '10';
causing error: error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax use near ''0' ,'10''
note 1. know there option limit in $params array..
note 2. there question related here
note 3. have tried: $values [] = intval($offset)
, $values [] = (int)$offset
, , integer like: $values [] = 10
i dunno cake in pdo should use both intval
, pdo::param_int
- none of them separately.
in pdo wrapper have issue fixed, allowing first code run without errors, doubt bother implementing framework
Comments
Post a Comment