Forum Moderators: coopster
Say, $x = 'get me out'
In mySQL table, I have a row that matches $x, but it is more like in 'Get ME out'.
I want to match $x to that row. Is there something I can do to manipulate the mySQL SELECT query by changing the rows to lowercase letters before matching with $x.
So, I am thinking of something like this.
"SELECT * FROM TABLE WHERE $x = name" <-- where name column has to be changed to lower case.
Thanks for your time.
I am not good at this and I am sure there is a better solution.
You could read all the mysql fields in to variables, copy these veriables to a second set of veriable.
Make all those lower cap.
Load them in to mysql.
Do your compare.
Then load the first set of veriables with mixed case back in to your mysql.
Is that funny?
:))
SELECT * FROM hardware WHERE name regexp '$name' AND name regexp '^.{". $charcount ."}$'
REGEXP isn't case sensitive. So, problem solved kinda...
But I detected $charcount by counting the characters in the $name string. Reason I'm doing this is so that 'badger badger' won't match with 'badger badger mushroom' as the the strings have different char count.
It wasn't until I typed out the question in WWW before I can see a clear picture of my problem.
Thanks to all.