MySql Case Insensitive Order_by
If you like this post, please subscribe to our RSS feed to read our new posts every day.
While answering a question in the wordpress forums, I remembered an (obscure to me) function in php which generates a regular expressions ( regex ) to be used in a MySql query. This is very useful when performing a dynamic ORDER_BY or a SELECT and you do not want to use the LIKE statement. The syntax is as follows:
$new_string = mysql_regcase($string);
Where the $string was the original query string and the $new_string is the regex for that query string. I am not sure whether WordPress uses this or not. However, it sure could prove useful in unlikely circumstances.
Visitors who read this post, also read:
Related posts from the past
- Javascript escape encode to PHP readable
- WordPress Plugin Releases for 11/2
- Regular Expressions Tutorial
- Mysql Query Diagnostic Plugin for Wordpress
- WordPress Plugin Releases for 8/14
- Online Regex Tester
- Upgraded to WP 2.1 Ella
- IdeaBox: Simple PHP Bulletin Board
- ONLamp.com: Five Habits for Successful Regular Expressions
- How to: Offsets and Paging











Comments RSS
test
[Reply]
Mark (14 comments.) — 02/7/2004 @ 8:21 pmCool. I never knew this function existed.
[Reply]
Jason (1 comments.) — 08/6/2005 @ 11:20 pm