[Typo3-dev] Core patches, SQL question

Ries van Twisk typo3 at rvt.dds.nl
Mon Aug 1 14:50:07 CEST 2005


Bernhard Kraft wrote:

>Hallo,
>
>
>Currently I'm going to implement some of my extensions into the core after the request list found on:
>http://wiki.typo3.org/index.php/Extensions_for_the_core
>(All my kb_ extensions)
>
>
>Currently I'm almost finished with the kb_cont_slide extension.
>
>I have to return a mysql result resource in a method but I have problems generating the query. I have
>an array containing all uid's i wish to select in SORTED order.
>
>Selecting them using
>WHERE uid IN ('.implode($uidList).')
>resulted in a list ordered absolutely NOT in the order in which I gave the uid's in the list ...
>
>which is correct following the mysql-syntax ... WHERE don't sort records.
>
>
>So how could I apply some ORDER BY statement which sorts the records by the given list ?
>
>
>  
>
exec_SELECTquery provided a way to do that see:

exec_SELECTquery <http://typo3api.ueckermann.de/classt3lib__sqlengine.html#a6>($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit)

NOTE:it's even so that the order can change with every SELECT statement if not using a orday_by clause.

cheers,
Ries



-- 
R. van Twisk
http://www.metamorf.net

Our Typo3 enabled website: http://www.livetravelguides.com
Instand help for Typo3?    irc:/irc.freenode.net/typo3
Looking for documentation? http://typo3.org/documentation/






More information about the TYPO3-dev mailing list