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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -