Forum Moderators: coopster

Message Too Old, No Replies

php is generating case inconsistencies

         

distorto

10:03 pm on Dec 27, 2007 (gmt 0)

10+ Year Member



I'm pulling an array of names from mysql and storing them in an array - then I query the same database with a different query and output the names (with info) one by one, testing each time to see if the name being output matches one of the names in the array. In this way, I'm letting people know which names are "mutual" between the two categories.
but when I test the name using in_array(), I'm getting inconsistent results. After looking at the site a bit, I began to notice a number of case inconsistencies. MyNameIsDORK might be changed to mynameisdork. I know in_array() is case sensitive, but the names are coming form the same database and I can't see anything I'm doing that would convert to lowercase. When I get results from mysql, I use stripslashes(). When I enter things into mysql, I use mysql_real_escape.

eelixduppy

8:03 am on Dec 28, 2007 (gmt 0)



The only thing I can say is to check your database manually to see if the values in there are actually what you think they are. If they are, and you are still getting case-insensitive problems, you might want to follow your code exactly and see what is happening to those values each step of the way. If you have to add extra echos after each function call then do it to see what is causing the problem. It seems like something minor, though, once you find out what it actually is.

If you still cannot find it, post the relevant code and we'll take a peek.