AllThingsTrendy Posted July 19, 2005 Share Posted July 19, 2005 OK. I admin I'm a total novice. I'm new to sql. I'm a spoiled Lotus Notes developer with new clue what I'm doing yet. All of my product names are in UPPERCASE. I know this is vweery vweery bad. Can someone please help me with an sql to conver these to propercase? thanks!!! Anthony David AllThingsTrendy.com Link to comment Share on other sites More sharing options...
FalseDawn Posted July 20, 2005 Share Posted July 20, 2005 If your product names are more than 1 word then it's not simple to do it in SQL - your best bet would be to knock up a PHP script and use ucwords. Outline: require('includes/application_top.php'); $q = tep_db_query('SELECT products_id,products_description FROM ' . TABLE_PRODUCTS); while ($row=tep_db_fetch_array($q)) { tep_db_query('UPDATE ' . TABLE_PRODUCTS . ' SET products_description=\'' . tep_db_input(ucwords(strtolower($row['products_description']))) . '\' WHERE products_id=' . $row['products_id']); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.