Converting Letter Case in php/MySql

Sometimes we might be in need to convert the output results in upper case or lower case format MySQL comes up with a solution for that where you can use LCASE and UCASE to convert the results into any one format completely.

LCASE can be used in MySQL query to get the output in all lower case letters.

For example below query will display the username in lowercase.

SELECT lcase(username) FROM `users`

Similarly UCASE can be used for getting the output in all upper case letters.

Alternatively, we can use php functions strtolower() andstrtoupper() for achieving the same.

Posted in MySQL Tagged with: ,