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>"; 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']); 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 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! 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
Archived
This topic is now archived and is closed to further replies.