ucwords for mySQL?

ucwords for mySQL?

am 19.03.2011 19:04:35 von ron.piggott

------=_NextPart_000_007B_01CBE63E.941A6630
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


I have found mySQL commands for LCASE and UCASE, but nothing equal to =
the PHP command â€=9Cucwordsâ€=9D. =20
Is there a mysql command or will I need to use PHP to manipulate the =
strings? Ron

The Verse of the Day
â€=9CEncouragement from Godâ€=99s Wordâ€=9D
http://www.TheVerseOfTheDay.info =20

------=_NextPart_000_007B_01CBE63E.941A6630--

RE: ucwords for mySQL?

am 19.03.2011 19:21:11 von Oddity Software LLC

Need a custom function:

BEGIN
DECLARE c CHAR(1);
DECLARE s VARCHAR(128);
DECLARE i INT DEFAULT 1;
DECLARE bool INT DEFAULT 1;
DECLARE punct CHAR(17) DEFAULT ' ()[]{},.-_!@;:?/';
SET s =3D LCASE( str );
WHILE i < LENGTH( str ) DO=20
BEGIN
SET c =3D SUBSTRING( s, i, 1 );
IF LOCATE( c, punct ) > 0 THEN
SET bool =3D 1;
ELSEIF bool=3D1 THEN=20
BEGIN
IF c >=3D 'a' AND c <=3D 'z' THEN=20
BEGIN
SET s =3D CONCAT(LEFT(s,i-1),UCASE(c),SUBSTRING(s,i+1));
SET bool =3D 0;
END;
ELSEIF c >=3D '0' AND c <=3D '9' THEN
SET bool =3D 0;
END IF;
END;
END IF;
SET i =3D i+1;
END;
END WHILE;
RETURN s;
END

Regards,
=20
Will T
Chief Technical Officer
=20
Oddity Software LLC
http://www.odditysoftware.com


-----Original Message-----
From: Ron Piggott [mailto:ron.piggott@actsministries.org]=20
Sent: Saturday, March 19, 2011 1:05 PM
To: php-db@lists.php.net
Subject: [PHP-DB] ucwords for mySQL?


I have found mySQL commands for LCASE and UCASE, but nothing equal to =
the PHP command â€=9Cucwordsâ€=9D. =20
Is there a mysql command or will I need to use PHP to manipulate the =
strings? Ron

The Verse of the Day
â€=9CEncouragement from Godâ€=99s Wordâ€=9D
http://www.TheVerseOfTheDay.info =20


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: ucwords for mySQL?

am 19.03.2011 21:36:48 von Karl DeSaulniers

Try this,

$String =3D strtolower($String);
or
$String =3D strtoupper($String)

then plug into MySQL

Best,
Karl


On Mar 19, 2011, at 1:21 PM, Oddity Software LLC wrote:

> Need a custom function:
>
> BEGIN
> DECLARE c CHAR(1);
> DECLARE s VARCHAR(128);
> DECLARE i INT DEFAULT 1;
> DECLARE bool INT DEFAULT 1;
> DECLARE punct CHAR(17) DEFAULT ' ()[]{},.-_!@;:?/';
> SET s =3D LCASE( str );
> WHILE i < LENGTH( str ) DO
> BEGIN
> SET c =3D SUBSTRING( s, i, 1 );
> IF LOCATE( c, punct ) > 0 THEN
> SET bool =3D 1;
> ELSEIF bool=3D1 THEN
> BEGIN
> IF c >=3D 'a' AND c <=3D 'z' THEN
> BEGIN
> SET s =3D CONCAT(LEFT(s,i-1),UCASE(c),SUBSTRING(s,i+1));
> SET bool =3D 0;
> END;
> ELSEIF c >=3D '0' AND c <=3D '9' THEN
> SET bool =3D 0;
> END IF;
> END;
> END IF;
> SET i =3D i+1;
> END;
> END WHILE;
> RETURN s;
> END
>
> Regards,
>
> Will T
> Chief Technical Officer
>
> Oddity Software LLC
> http://www.odditysoftware.com
>
>
> -----Original Message-----
> From: Ron Piggott [mailto:ron.piggott@actsministries.org]
> Sent: Saturday, March 19, 2011 1:05 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] ucwords for mySQL?
>
>
> I have found mySQL commands for LCASE and UCASE, but nothing equal =20
> to the PHP command =93ucwords=94.
> Is there a mysql command or will I need to use PHP to manipulate =20
> the strings? Ron
>
> The Verse of the Day
> =93Encouragement from God=92s Word=94
> http://www.TheVerseOfTheDay.info
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php