Re: ucwords() usage QUICKIE

From: Date: Fri, 14 Jun 2002 21:13:24 +0000
Subject: Re: ucwords() usage QUICKIE
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-102271@lists.php.net to get a copy of this message
DNK> I am trying to figure out how to use ucwords here : DNK> if (submit) DNK> $db = mysql_connect($dbhost,$dbuname,$dbpass); DNK> mysql_select_db($dbname,$db); DNK> ucwords($sql) <<<<< Is this correct ? DNK> $sql = "INSERT INTO $prefix"; DNK> $sql .= "(first, last, email, company, address, city, state, zip, DNK> phone, fax, mobile, comments)"; DNK> $sql .= "VALUES"; DNK> $sql .= "('$first', '$last', '$email', DNK> '$company', '$address', DNK> '$city', '$state', '$zip', '$phone', DNK> '$fax', '$mobile', '$comments')"; DNK> also can you do this @ field level ? Currently, you are ucwords-ing an empty string. That being said, I'm not sure what you are trying to do anyway. ucwords() upper-cases the first letter of words in a string. (http://www.php.net/manual/en/function.ucwords.php) such as: $string = "this is a test"; $newstring = ucwords($string); echo $newstring // This Is A Test - Julie --> Julie Meloni --> julie@thickbook.com --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

« previous php.general (#102271) next »