[TYPO3-project-formidable] A problem with datasource:DB
Jerome Schneider
typo3dev at ameos.com
Thu Nov 15 14:07:30 CET 2007
Hi Ivan,
ds_db should be able to handle group by statements in sql-queries since
revision 103; are you using up-to-date revision ? if yes, it should be a
bug of the ds_db object.
Excerpt from http://www.ameos.com/formidable/svn/full-changelog.html
-----------
Revision: 103
Author: jschneiderameos
Date: 16:58:20, mardi 7 août 2007
Message:
ds_db/api/class.tx_dsdb.php:
-> now support GROUP BY statements in given sql query
-------------
Jerome Schneider
Ivan Gomez Rodriguez a écrit :
> I'm trying to use a datasource like follows:
>
> <datasource:DB name="list_make_datasource">
> <sql><![CDATA[
> SELECT
> makes.make as make_name ,count(*) as num
> FROM
> tx_glcarauctionsystem_car cars
> LEFT JOIN tx_glcarauctionsystem_static_make makes
> ON cars.make = makes.uid
>
> GROUP BY makes.uid
> ]]>
> </sql>
> </datasource:DB>
>
> but formidable core builds the following not well built query
>
> SELECT SQL_CALC_FOUND_ROWS makes.make as make_name ,count(*) as num
> FROM tx_glcarauctionsystem_car cars
> LEFT JOIN tx_glcarauctionsystem_static_make makes
> ON cars.make = makes.uid
> GROUP BY makes.uid
> WHERE TRUE LIMIT 0, 3
>
> And WHERE must be placed before GROUP BY.
>
> I know the problem is in tx_dsdb:_getSql() but i don't know how solve it
> :)
>
> Regards,
>
> Iván Gómez Rodríguez
> Ingeniero en Informática
> mailto:igomez at igalia.com
>
More information about the TYPO3-project-formidable
mailing list