Posted on Leave a comment

Doctrine_Pager error “Invalid parameter number” when using “IN” in “WHERE” clause

This post is just to inform fellow users of Doctrine about a problem with Doctrine_Pager using “IN” for “WHERE” clauses.

Simply put: Just don’t use it (at the moment), as it will result in the following error:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

Instead, use orWhere() for instance to get the desired result.