[TYPO3-dev] exec_SELECTgetRows parameters

Dmitry Dulepov [typo3] dmitry at typo3.org
Wed Jul 9 10:38:21 CEST 2008


Hi!

Fr. Simon Rundell SCP wrote:
> Has anyone had any success with ordering the results of exec_SELECTgetRows
> in descending order?

Yes but not your way ;)

> $res=$GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid", "tx_table", "1=1", "uid
> DESC", 1);

You pass "uid DESC" to "group by", not "order by". And you pass "1" to "order by". Check function parameters:

function exec_SELECTgetRows($select_fields,$from_table,$where_clause,
	$groupBy='',$orderBy='',$limit='',$uidIndexField='')

And use single quotes, not double ;) It saves you time for each request.

Good luck!

-- 
Dmitry Dulepov
http://typo3bloke.net/




More information about the TYPO3-dev mailing list