[TYPO3-english] JOIN ... AS ... in Typoscript
Jigal van Hemert
jigal.van.hemert at typo3.org
Tue Feb 19 15:55:29 CET 2013
Hi,
On 19-2-2013 14:36, Ralf-Rene Schröder wrote:
> count = TEXT
> count.numRows.table = tx_ifcwmedia_mediaitems
> count.numRows.select {
> join = tx_ifcwmedia_mediaitems_genres_mm AS mm1
> ON(tx_ifcwmedia_mediaitems.uid=mm1.uid_local)
> JOIN tx_ifcwmedia_mediaitems_genres_mm AS mm2
> ON(tx_ifcwmedia_mediaitems.uid=mm2.uid_local)
> where = mm1.uid_foreign=30 AND mm2.uid_foreign=4
> }
>
> (info: join = is only one row in my TS)
> is it possible that the JOIN ... AS is not possible in Typoscript ???
You can use AS (or remove the keyword 'AS' for slightly better DBAL
compatibility); the parts are used directly in building the query (apart
from some processing -- like markers -- but not relevant in this case).
Maybe you forgot about settings like select.pidInList? This defaults to
'this' (= current page), so if the records are not in the current page...
You also didn't set select.selectFields, but as it defaults to '*' it
won't matter too much here.
Finally, the condition for starttime, endtime, hidden, deleted,
fe_groups, etc. are automatically added.
If you want to find out the exact query that's executed you can activate
the Install Tool options to display failed queries and deliberately
introduce an error (by removing the first character of one of the table
or field names) in your query. The full query (with the error) will be
displayed.
--
Jigal van Hemert
TYPO3 Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list