I am creating a php form that gathers imput for a sql statement where clause. I need it to cope with the user typeing in upper or lower case. So I plan on converting the users entry to lower case and want to write the where clause to also convert the data its comparing to lower case. Does anyone know the best way to do this?
That's excellent thank you! Just for you info the php syntex is = strtolower($input)
Be careful with that. I deliberately wrote it as an SQL function. If you use the PHP function, make sure that special characters (that is non-7bit ASCII) characters are converted the same way by PG and PHP.
Otherwise you might not get correct results. If you can pass a variable to PG's lower() function, you are on the safe side, because both lower() conversions are identical. As an example: make sure that lower('ÖÄÜß') is the same as strtolower('ÖÄÜß') (or whatever special characters you might have)