I don't believe that query() takes more than a single param. If it
does, though, I'd think that probably should be:

$params = array(1,2) ;

On Fri, Nov 19, 2010 at 11:49 AM, Dan <[email protected]> wrote:
> 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
>

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

Reply via email to