If that's the case then ideally you need to remove all case sensitivity... (it was a bit hard to work out what you were doing - especially from the limited code you posted - it doesn't relate very well to the update you made..)
e.g. adjust the text entered so that behind the scenes...
Text entered, John Smith or john smith or JOHN SMITH
becomes john smith
Then make sure that the matching field in your SQL query - not sure how this is structured, but also case insensitive as well.. otherwise if it's held as John Smith on the database you will never match on it, even if your User enters John Smith.
e.g. use LOWER or LIKE
But still not sure what your SQL looks like when you execute the fetch of a single or multiple values...