RE: [PHP-DB] Case-insensitive SELECT From: Sam Masiello (smasiello <email protected>)
Date: 08/15/00

Although it might be a design change, how about converting the text to the
case that you want before inserting it into the table? Meaning, convert the
text to lower case upon inserting it into the table. This will eliminate
possibly having mixed case. For example, what if for some reason your data
read either "Mydata" or "mydata" or "MyDaTa"....you don't want to check for
every possible instance of mixed case, but if you standardize it and make it
all lower case (or all upper...whatever) before insertion into the table,
then you would only have to check for the case of "mydata"

HTH

Sam Masiello
System Analyst
Chek.Com
(716) 853-1362 x289
smasiello <email protected>

 -----Original Message-----
From: David B. Small [mailto:dbsmall <email protected>]
Sent: Tuesday, August 15, 2000 3:57 PM
To: php-db <email protected>
Subject: [PHP-DB] Case-insensitive SELECT

Apologies in advance for what is assuredly a naive question.

I think I understand the SELECT...WHERE...LIKE query form (although I'm
still not sure why, with ODBC at least, I must use % instead of *...or why
it even works)

But suppose I want to find all rows of "table" in which "field" is "Field
Name"....

I'd use "SELECT * FROM tale WHERE field='Field Name'"

If I now wanted it to match on 'Field Name', "Field name", "field name",
"Field" etc., but not "Field Value"

I could do some string manipulations, and perform many selects.
But is there a more efficient way of expressing wildcards (either in SQL or
in PHP's interface to it)?
(eg, I'd love to say field LIKE [F|f]ield[| [N|n]ame] or something like
that)

-----------------
David B. Small
dbsmall <email protected>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>