izbryte Posted August 22, 2008 Share Posted August 22, 2008 I have a checkbox field in a mysql database that is fed through a form on a website and I accidentally forgot to capitilize the first letter (word should be Word). It is part of an array. Now there are 100's of listings. Is there an easy way for me to go in change them all at one time in phpmyadmin? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 22, 2008 Share Posted August 22, 2008 ucwords in php can solve this. Quote Link to comment Share on other sites More sharing options...
akitchin Posted August 22, 2008 Share Posted August 22, 2008 there's no handy function, according to the manual, to do this in a MySQL query, but you can use a combination of them: UPDATE table SET field=CONCAT(UPPER(LEFT(field, 1)), RIGHT(field, CHAR_LENGTH(field) - 1)) this will set field equal to the uppercase version of the first character followed by the remainder of the value as it was. i would duplicate your data into a test table to check that it works there first, before you go and operate this directly on your dataset. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.