PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Jul 05, 2020 8:20 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Mar 21, 2016 5:24 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4434
Location: United Kingdom
I need to update all the entries in a db field, so the first letter is UPPERCASE.
I've looked online and there seems to be a few ways, but each time i try it, it errors.

Syntax: [ Download ] [ Hide ]
mysql_query("UPDATE pages SET title = UC_Words(title) WHERE id = '$row->id'");

This doesn't work. I get the message:
Syntax: [ Download ] [ Hide ]
#1305 - FUNCTION website.CAP_FIRST does not exist

Is it because this is "old"??

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Mon Mar 21, 2016 6:38 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
There is no MySQL function UC_Words. You will likely want to use UPPER and SUBSTRING.

_________________


Top
 Profile  
 
PostPosted: Mon Mar 21, 2016 5:39 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
I searched the Interwebs and found this pretty quickly:

http://www.artfulsoftware.com/infotree/ ... php?id=122

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group