[TYPO3-dev] Problem with pi_list_browseresults()
Brian Bendtsen
nightowl at galnet.dk
Thu May 10 14:28:49 CEST 2007
Peter Russ skrev:
> Well: if you query returns a result of 4 rows, but you want to get only
> 2 unique rows, than you should fix your query.
> SQL just delivers what you ASK for and can not guess what you expect to
> get ;-)
> Wrong result, wrong question . Pretty plain.
>
> Regs. Peter.
>
>
In a simple query you can use the same query for showing the result on a
page and for showing the result browser.
When I use my query for showing the result I get 2 rows which is fine.
When I use the same query, adding count, I get a number of rows to be 4.
That is the main problem.
Now I have rewritten the query for returning the number of rows, using
$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(distinct
tx_ebbolig_afdeling.uid)','tx_ebbolig_afdeling INNER JOIN
tx_ebbolig_lejemaal ON tx_ebbolig_afdeling.uid =
tx_ebbolig_lejemaal.afdelingid',$where);
instead of the pi_exec_query, where the distinct is not possible.
So, query for showing result was right. Query for result browser was wrong.
/BB
More information about the TYPO3-dev
mailing list