I'm looking at running a custom parametrized query. Here's my test
model:
class Project extends AppModel {
var $name = 'Project';
var $primaryKey = 'project_id';
function testInClause(){
$sql = <<<XSQL
select project_id, project_name
from tsdmgr_projects projects
where project_id in (?)
XSQL;
$params = array( array(1,2) );
return $this->query($sql, $params);
}
}
I get the following error:
Warning (2): strlen() expects parameter 1 to be string, array given
The SQL that gets executed:
select project_id, project_name from tsdmgr_projects projects where
project_id in (1)
I've tried this also without success:
$params = array(1,2);
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en