Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

php/mysql all caps

New Here ,
Jan 13, 2009 Jan 13, 2009
I have a php mysql insert record application built in dreamweaver. Is there a way to force or convert all inputted text to all caps? I tried a style sheet text transform, but that doesn't make the actual entry into the database all caps. Thanks.
TOPICS
Server side applications
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
.oO(BrianArena)

>I have a php mysql insert record application built in dreamweaver. Is there a
>way to force or convert all inputted text to all caps?

You can use PHP to convert the text before it goes into the database
(see strtoupper()). May I ask why you want this?

>I tried a style sheet
>text transform, but that doesn't make the actual entry into the database all
>caps. Thanks.

Stylesheets are only for presentation in a user agent/browser, they
don't manipulate any data.

Micha
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 13, 2009 Jan 13, 2009
Thanks, I'll give it a try

The database feeds a content for a scoreboard ticker, lower case letters do not display as legibly as uppercase.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
Do the case conversion after retrieving the data from the database.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"BrianArena" <webforumsuser@macromedia.com> wrote in message
news:gkiqlc$2ct$1@forums.macromedia.com...
> Thanks, I'll give it a try
>
> The database feeds a content for a scoreboard ticker, lower case letters
> do not display as legibly as uppercase.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 13, 2009 Jan 13, 2009
The scoreboard system does not have that ability to do case conversion, but I understand what you're getting at. Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
Murray *ACE* wrote:
> Do the case conversion after retrieving the data from the database.

Why? That means converting the data every time it's displayed. If the
data is always required as uppercase, it makes more sense to convert it
once at the time of storage.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
Glad you are back to keep me honest. 8)

But really, it makes so little difference either way....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"David Powers" <david@example.com> wrote in message
news:gkj73a$hvg$1@forums.macromedia.com...
> Murray *ACE* wrote:
>> Do the case conversion after retrieving the data from the database.
>
> Why? That means converting the data every time it's displayed. If the data
> is always required as uppercase, it makes more sense to convert it once at
> the time of storage.
>
> --
> David Powers, Adobe Community Expert
> Author, "The Essential Guide to Dreamweaver CS4",
> "PHP Solutions" & "PHP Object-Oriented Solutions"
> http://foundationphp.com/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
On Tue, 13 Jan 2009 23:09:15 +0000, David Powers <david@example.com>
wrote:

>Why? That means converting the data every time it's displayed. If the
>data is always required as uppercase, it makes more sense to convert it
>once at the time of storage.

For the most part, I agree. However, there is the possibility down the
road, that they might want to use the data for something other than the
current ticker. In that case, it might display better in mixed case. It's
a lot easier to convert to all upper case for the ticker, than to try to
convert all upper case to mixed case.

Gary
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 13, 2009 Jan 13, 2009
Admittedly though, that's pretty easy too.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Gary White" <reply@newsgroup.please> wrote in message
news:fnbqm4p8674l90s5p952kolst10jpbv8pp@4ax.com...
> On Tue, 13 Jan 2009 23:09:15 +0000, David Powers <david@example.com>
> wrote:
>
>>Why? That means converting the data every time it's displayed. If the
>>data is always required as uppercase, it makes more sense to convert it
>>once at the time of storage.
>
> For the most part, I agree. However, there is the possibility down the
> road, that they might want to use the data for something other than the
> current ticker. In that case, it might display better in mixed case. It's
> a lot easier to convert to all upper case for the ticker, than to try to
> convert all upper case to mixed case.
>
> Gary

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2009 Jan 14, 2009
On Tue, 13 Jan 2009 20:11:44 -0500, "Murray *ACE*"
<forums@HAHAgreat-web-sights.com> wrote:

>Admittedly though, that's pretty easy too.

Really? I've always found it to be *very* problematic.

Gary
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2009 Jan 14, 2009
Gary White wrote:
> Really? I've always found it to be *very* problematic.

Depends what you want, but a combination of strtolower() and ucfirst()
or ucwords() should do the trick.

$string = 'ALL CAPITALS';
echo ucfirst(strtolower($string)); // All capitals
echo ucwords(strtolower($string)); // All Capitals

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2009 Jan 14, 2009
On 14 Jan 2009 in macromedia.dreamweaver.appdev, David Powers wrote:

> Gary White wrote:
>> Really? I've always found it to be *very* problematic.
>
> Depends what you want, but a combination of strtolower() and ucfirst()
> or ucwords() should do the trick.
>
> $string = 'ALL CAPITALS';
> echo ucfirst(strtolower($string)); // All capitals
> echo ucwords(strtolower($string)); // All Capitals

Yeah, but Mister MacDonald might not approve of the results...

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2009 Jan 14, 2009
Joe Makowiec wrote:
> Yeah, but Mister MacDonald might not approve of the results...

True. Gary's right about it being more flexible to store text in mixed
case. The extra overhead of converting it to uppercase each time it's
retrieved might be worthwhile unless the site gets very heavy usage.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 14, 2009 Jan 14, 2009
LATEST
On Wed, 14 Jan 2009 15:47:30 +0000, David Powers <david@example.com>
wrote:

>Depends what you want, but a combination of strtolower() and ucfirst()
>or ucwords() should do the trick.
>
>$string = 'ALL CAPITALS';
>echo ucfirst(strtolower($string)); // All capitals
>echo ucwords(strtolower($string)); // All Capitals

As Joe says, that approach will yield less than desirable results in many
cases. One of those would be names with capitals included inside the name,
like McIntosh, or MacDonald. Another would be cases where another
character is the first like (parenthesis). Or consider a sentence with a
name included: I really like david's books. It really is difficult, if not
impossible, to really convert to mixed case reliably.

If you can be absolutely POSITIVE that you will NEVER need mixed case
again, then I agree you should store it in upper case. If there is any
possibility, however remote, that you might need mixed case again, my
opinion is that you should store it in mixed case.

Gary
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines