[PHP-DB] Re: Using functions in SELECT statements
Your problem may be the use of single quotes around your wildcard search string. I haven't tested it but SQL probably works like PHP in that single quotes denote exact values while double quotes allows evaluation of the quoted string. -Kevin Robin S McKenzie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm trying perform a case-insensitive test for a name. These are stored like Association of ..., and I want to convert both the filter and the test data to lower- (or upper-) case. Why doesn't this work: ? SELECT * FROM [Organisation Membership] WHERE lower(organisation) LIKE lower('%$SearchBox$%') Robin McKenzie Department of Mechanical Engineering University of Bristol e:[EMAIL PROTECTED] e:[EMAIL PROTECTED] m:+44(0)7970 058712 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Using functions in SELECT statements
Is this in SQL server? It seems we don't have enough of the code to be able to tell the problem. The query has to be put in a string and SearchBox has to exist, and this all has to be run from a query function, and well, if you actually show your php code it would help quite a bit. :-) -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 4:44 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Using functions in SELECT statements Your problem may be the use of single quotes around your wildcard search string. I haven't tested it but SQL probably works like PHP in that single quotes denote exact values while double quotes allows evaluation of the quoted string. -Kevin Robin S McKenzie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm trying perform a case-insensitive test for a name. These are stored like Association of ..., and I want to convert both the filter and the test data to lower- (or upper-) case. Why doesn't this work: ? SELECT * FROM [Organisation Membership] WHERE lower(organisation) LIKE lower('%$SearchBox$%') Robin McKenzie Department of Mechanical Engineering University of Bristol e:[EMAIL PROTECTED] e:[EMAIL PROTECTED] m:+44(0)7970 058712 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Using functions in SELECT statements
(in response to my own response) By the way it just occured to me that the default SELECT statement is already case insensitive. So is any of this is even necessary? If you want to display the selected items in lower case, then do that in your script with strtolower(); -Kevin Robin S McKenzie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm trying perform a case-insensitive test for a name. These are stored like Association of ..., and I want to convert both the filter and the test data to lower- (or upper-) case. Why doesn't this work: ? SELECT * FROM [Organisation Membership] WHERE lower(organisation) LIKE lower('%$SearchBox$%') Robin McKenzie Department of Mechanical Engineering University of Bristol e:[EMAIL PROTECTED] e:[EMAIL PROTECTED] m:+44(0)7970 058712 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php