Re: [PHP] ucwords() usage QUICKIE
You pass a string to the function and it returns a string with each word starting with an uppercase. $string = "hello world"; $new_string = ucwords($string); echo $new_string; // Displays 'Hello World' ---John Holmes... - Original Message - From: "Daniel Negron/KBE" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 5:06 PM Subject: [PHP] ucwords() usage QUICKIE > Hi All, > > I am trying to figure out how to use ucwords here : > if (submit) > $db = mysql_connect($dbhost,$dbuname,$dbpass); > mysql_select_db($dbname,$db); > ucwords($sql) < Is this correct ? > $sql = "INSERT INTO $prefix"; > $sql .= "(first, last, email, company, address, city, state, zip, > phone, fax, mobile, comments)"; > $sql .= "VALUES"; > $sql .= "('$first', '$last', '$email', '$company', '$address', > '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')"; > also can you do this @ field level ? > > > Danny > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ucwords() usage QUICKIE
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', '$company', '$address', DNK> '$city', '$state', '$zip', '$phone', '$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 --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ucwords() usage QUICKIE
Looks like it, but you're missing the semi-colon at the end of the line. > -Original Message- > From: Daniel Negron/KBE [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 14, 2002 2:06 PM > To: [EMAIL PROTECTED] > Subject: [PHP] ucwords() usage QUICKIE > > > Hi All, > > I am trying to figure out how to use ucwords here : > if (submit) > $db = mysql_connect($dbhost,$dbuname,$dbpass); > mysql_select_db($dbname,$db); > ucwords($sql) < Is this correct ? > $sql = "INSERT INTO $prefix"; > $sql .= "(first, last, email, company, address, > city, state, zip, > phone, fax, mobile, comments)"; > $sql .= "VALUES"; > $sql .= "('$first', '$last', '$email', '$company', > '$address', > '$city', '$state', '$zip', '$phone', '$fax', '$mobile', '$comments')"; > also can you do this @ field level ? > > > Danny > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php