[Typo3-dev] Core patches, SQL question

Peter Russ peter.russ at 4many.net
Tue Aug 2 13:02:46 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 ?
> 
> 
> greets,
> Bernhard
You can't as the order of the list is not relevant for the query. You 
have to order the records by yourself.
By the way implode(',',$uidList) ;-)

Regs Peter.

-- 
_____________________________
4Many® Services
openBC: http://www.openbc.com/go/invuid/Peter_Russ




More information about the TYPO3-dev mailing list