Page 1 of 1

Can the content of a field be sent to Capitalized?

Posted: Tue May 17, 2016 3:36 am
by simonmlewis
We have a table that has a $row->title field. I want to copy them all over to the "titletag" field. But I want to do it so it's in Capitalized format:

this is a field > This Is A Field.

Thankfully the words are not A, Is, To.... So it's fine. How do I do that?

Re: Can the content of a field be sent to Capitalized?

Posted: Tue May 17, 2016 6:20 am
by Celauran
MySQL doesn't have a titlecase function, but you can write one in SQL or you can do it in PHP and bulk update.

Re: Can the content of a field be sent to Capitalized?

Posted: Tue May 17, 2016 7:02 am
by simonmlewis
Yes - I guess I can copy them over, then do an update on all to be titlecase. Thanks anyway.