[TYPO3-mvc] Big problems (Bug?) with $query-in() (little bit urgent)

Xavier Perseguers typo3 at perseguers.ch
Mon Sep 27 08:54:00 CEST 2010


Hi Manfred,

> i had a table where some relations between objects are stored. In one field
> i have comma seperated uid`s stored. No i have to query some things in
> relation with other ones. Example:
>
> My field fahrzeug contains this: 13,14
>
> Now, perform the query:
>
> $query->matching(
> 	$query->in('fahrzeug',array(13))
> );
> $query->execute();
> [...]
> The extbase produces for values for IN() queries this: "fahrzeug IN ('13')"
> but instead of that i need fahrzeug IN (13) to get my sql working. If i
> have only one value in the table field extbase works with his  single
> qoute. But i cant say to my client that he puts only only one relation in
> that field ;-)

You don't want a IN query, but a FIND_IN_SET instead! and for 
FIND_IN_SET there is already a dedicated operator in Extbase, that's 
"contains".

This leads me to wonder why Extbase is using multiple LIKE statements 
instead of FIND_IN_SET, I was sure it had been updated. Anyway, that's 
the operator you want.

Best
Xavier Perseguers


More information about the TYPO3-project-typo3v4mvc mailing list