..


Sponsored Links

MySQL has a similar function ucfirst () in PHP to convert a string to lower case with only the first letter capitalized?

MySQL, unfortunately, does not natively have a similar function ucfirst () in PHP. To achieve this within a query must use more functions combined. Here's an example:

 



 SELECT CONCAT (UPPER (LEFT (field, 1)), LOWER (SUBSTRING (field FROM 2))) AS temp FROM table;

 
If you wish to make an update on the data in the table:
 



 UPDATE table SET field = CONCAT (UPPER (LEFT (field, 1)), LOWER (SUBSTRING (field FROM 2)));

 

In the same category ...
E-Learning
MS Access (Advanced) MS Access (Advanced)
Learn how to create and manage databases quickly and easily. Starting from 29 €.
MySQL (Course) MySQL (Course)
Management of open-source database. From 39 €.
SQL and Database (Course) SQL and Database (Course)
Create and manage relational databases. From 39 €.
Sponsored Links