Link to home
Start Free TrialLog in
Avatar of Eaddy Barnes
Eaddy BarnesFlag for United States of America

asked on

Changing the CASE of letters in Output

Hello Folks,

I would like to change the upper case of certain letters of the output from a certain column in a table..

e.g 1 here making the first letter in the output in Caps and the rest in all lowercase letters

before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99

after:
select , description, price from tbl_name
output Sony blu-ray internal drive(black), $9.99


e.g 2 here making the first letter of every word in the output in Caps and the rest in all lowercase letters

before:
select , description, price from tbl_name
output SONY BLU-RAY INTERNAL DRIVE SATA (BLACK), $9.99

after:
select , description, price from tbl_name
output Sony Blu-ray Internal Drive(Black), $9.99


thanks in advance
Avatar of Scott Madeira
Scott Madeira
Flag of United States of America image

you can do this for example 1:

$string = ucfirst(strtolower($string));

example two you could use:

$string = ucwords(strtolower($string));

May be some issues with the words inside (), though.  You will need to play with it.
Hi,


example 1:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucfirst(strtolower($mystring));

example 2:
$mystring = "HELLO HOW ARE YOU TODAY";
$mystring = ucwords($mystring);
lol, beat me to it smadeira... :P

Avatar of Eaddy Barnes

ASKER

hey guys i'm not using php at all for the output only mysql queries.
ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Why is it in the PHP zone then ? You are using PHP, there has to be some layer between the database and the page. And the easiest way to do what you want is to present data like jrm213jrm213 did.
It being in PHP Zone was my error..