webguync Posted April 3, 2009 Share Posted April 3, 2009 Hi, I am outputting information in a MySQL table and I wanted if possible to make sure the initial letter in the first and last names appears capitalized. Currrently some are and some aren't. Here is the code to extract the info: echo "<td>" . $row['employee_name'] . "</td>"; Quote Link to comment https://forums.phpfreaks.com/topic/152457-solved-capitalizing-the-first-letter-in-a-mysql-output/ Share on other sites More sharing options...
benphp Posted April 3, 2009 Share Posted April 3, 2009 ucwords($row['employee_name']); Quote Link to comment https://forums.phpfreaks.com/topic/152457-solved-capitalizing-the-first-letter-in-a-mysql-output/#findComment-800666 Share on other sites More sharing options...
premiso Posted April 3, 2009 Share Posted April 3, 2009 Alternatively you can do this in MySQL: SELECT UCASE(LOWER(`employee_name`)) FROM TABLE_NAME WHERE Condition=otherCondition Quote Link to comment https://forums.phpfreaks.com/topic/152457-solved-capitalizing-the-first-letter-in-a-mysql-output/#findComment-800669 Share on other sites More sharing options...
webguync Posted April 3, 2009 Author Share Posted April 3, 2009 cool, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/152457-solved-capitalizing-the-first-letter-in-a-mysql-output/#findComment-800681 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.