NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL and ORDER BY kludging

Chris Bielanski Cbielanski at inta.org
Wed Mar 3 10:54:36 EST 2004


I noticed that my mail encoding ate the special characters - oops. But you
nkow what I mean, the characters with grave, diaresis, circumflex, ciron,
accent, et al.

> -----Original Message-----
> From: Chris Bielanski [mailto:Cbielanski at inta.org]
> Sent: Wednesday, March 03, 2004 10:50 AM
> To: NYPHP Talk (E-mail)
> Subject: [nycphp-talk] MySQL and ORDER BY kludging
> 
> 
> Hey list,
> Does anyone have experience with making MySQL do an ORDER BY 
> for different
> (or multiple) charsets?
> 
> I have DB full of unicode (single-byte, I think) strings and 
> the default
> ORDER BY is UTF-8 according the MySQL docs. They also mention 
> that this can
> be altered but I couldn't quite figure out how to go about it.
> 
> Predictably, there is an interest in getting the sort from 
> the query such
> that:
> 
> $query = 'Select distinct from MYDB where strings >="S" and 
> strings < "T"';
> would capture "S-like" strings starting with  
> [S,s,S,s,S,s,S,s,S,s], which
> when UTF-8 sorted, the set [S,s,S,s,S,s,S,s] falls last, or > "Z"
> 
> and for another example, 'Select distinct from MYDB where 
> strings >="C" and
> strings < "D"'; would bring back strings starting with
> [C,c,ç,C,c,C,c,C,c,C,c].
> 
> Any insights?
> 
> Thanks,
> Chris Bielanski - [CBielanski at inta.org]
> Web Programmer, 
> International Trademark Association - [www.inta.org]
> 1133 Ave. of the Americas - Manhattan
> p - 212/642-1745
> 
> 
> 
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 



More information about the talk mailing list