Mailing List Archive



Back to the month index Back to the list index

Anderson, Hans (hans@marsweb.com)
Thu, 12 Sep 1996 08:30:57 -0700


Message-Id: <32382CB1.7269@marsweb.com>
Date: Thu, 12 Sep 1996 08:30:57 -0700
From: "Anderson, Hans" <hans@marsweb.com>
Subject: Re: [mSQL] Case insensitive sort

Straight from the PHP docs:

msql_RegCase(string)

     msql_RegCase takes a string argument and converts it to the regular
expression needed to send to mSQL in order to get a case insensitive
match. This turns a string like "abc" into "[Aa][Bb][Cc]".

example:

$search = msql_RegCase($query); /*where $query is the search word from a
form */

$result = ($db,"select * from tablename where name like '$query%'");

Hans

Jack Duan wrote:
>
> Hi there,
>
> I am using msql 1.0.16 with PHP/FI 2.0b4 on a Sparc20 running Solaris 2.4...
> After having done a set of CGI bases interfaces and bridges integrating
> mSQL with PHP/FI, user can access data using a web browser very easily.
> However, when doing searching, I really like to use case insensitive search,
> ie:
>
> 1. Jack
> 2. Jad
> 3. jacob
> 4. JC
>
> However, when using "SELECT * FROM database WHERE name LIKE '[j][J]%'" will
> produce:
>
> 1. Jack
> 2. Jad
> 3. JC
> 4. jacob
>
> in which case uppercase will always come first... is there a way to do
> case insenitive sort?
>

-- 
Hans Anderson  -- Hans Anderson  -- M@RSweb 
hans@marsweb.com -- eieio@marsweb.com
http://www.marsweb.com | http://www.ism.net
(406) 721-MARS | 288 Expressway | Missoula, MT  59802

No Soap! -------------------------------------------------------------------------- To remove yourself from the Mini SQL mailing list send a message containing "unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing "info msql-list" to majordomo@bunyip.com for info on monthly archives of the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!