Okay, so what's the problem? With the code you have and that output chart assuming the comparison is done on equality is correct. 'DEBBIE' <> 'debbie', so comparing them for equality would come to false.
So if the goal is simply to determine if all characters as lower case, than that will do the job.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php