[TYPO3-mvc] using more than one $query->like

Steffen Ritter info at rs-websystems.de
Wed Mar 3 09:26:45 CET 2010


Pascal Geldmacher schrieb:
> Hey,
> 
> I've a statement where i need more than one "like" querys.
> 
> I've try to implement it on this way:
> 
>     $query->matching($query->like('uid', intval($data[0])));
>     $query->matching($query->like('name', $name));
>     $query->matching($query->like('email', $data[3]));
>     $query->matching($query->like('zip', $data[5]));
>     $query->matching($query->like('city', $data[6]));
> 
> If i only works with the uid it works fine. But if take the other 
> information i got this error:
> #1217241834: Invalid variable name "uid4b8e1985afac4" given to bindValue.
> 
> Maybe i haven't understand how i have to use it right :).
> I won't write my own sql statement, so please help me :).
> 
> Greetings,
> 
> Pascal
did you search the list? this is discussed quite satisfying...
look at $query->logicalAnd or $query->logicalOr

You only can set one matching... Serveral conditions must be 
concatenated via the mentioned funktions.


More information about the TYPO3-project-typo3v4mvc mailing list