[TYPO3-mvc] how to search part of a string ( WHERE LEFT(code, 1) )
Stefano Cecere
scecere at krur.com
Mon Mar 26 11:06:14 CEST 2012
hi
while it's ok to search a string $q in field 'code' by
$query->like('code', '%' . $q . '%')
how can i search by first letter of 'code' ?
by raw mysql i would do fast by WHERE LEFT(code,1) = 'k'
but if i query with $query->equals('LEFT(code,1)', $q ) i get lot of
errors :)
is it possible with standard Extbase query engine, or should i bypass it
(in this case i would save the first letter of 'code' in a separate field
by TCE hook)?
thank you
--
____ ___ __ _ ______________________
Stefano Cecere
KRUR studio
More information about the TYPO3-project-typo3v4mvc
mailing list