How can I capitialize the first letter of each word mysql column

Hope, this will help you:) :heart:

You can use the UPPER() function to capitalize the first letter of each word in a MySQL column.

Example:

SELECT UPPER(column_name) FROM table_name;

1 Like

Uh, no.

MySQL UPPER() converts ALL the characters in a string to uppercase characters.

:joy: :joy: :joy: :joy: I’m such a mess.

You can use the UCWORDS() function in MySQL to capitalize the first letter of each word in a column. Here is an example query that demonstrates how to use this function:

UPDATE your_table SET your_column = UCWORDS(your_column);

Replace your_table with the name of the table that contains the column you want to modify, and your_column with the name of the column you want to modify.

This query will update the values in the specified column by capitalizing the first letter of each word. Note that this will modify the values in the column, so it’s a good idea to make a backup of your data before running this query.

sorry, no

that’s a php function, not a MySQL function

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.