Is there a reason why you have to capitalize the first letter? I have a
similar feature in my software and I use something like:
SELECT * FROM people WHERE last_name ILIKE "smith"
That does a case insensitive search.
You could also use:
SELECT * FROM people WHERE tolower(last_name) = tolower('smith')
or you could try:
SELECT * FROM people WHERE last_name in ('Smith','SMITH','smith')
This assumes that you are using "standard" SQL (which your example is
not). Just a little "added" feature of my first example is you could use:
...WHERE last_name ILIKE 'smith%' and get anyone who's name BEGINS with
'smith' (for example Smithe, Smithy...)
Hope that helps.
len morgan
Works great as long as the user enters the text string in the same case as
has been entered in the database. "Smith" = "Smith", but if the user enters
"smith" in the select box, the record is not found.
I want to do the database select with different text formats to make sure
that the record is found.
SELECT on "Smith", "smith", "SMITH"
I found the toupper() and tolower() functions, but how do you get the
function to change only the first letter toupper in a string?
Thanks in advance for the help. This cannot be that hard.
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution