Re: trimming or just getting only numbers from column
| From: | Richard Lynch | Date: | Tue, 28 Nov 2000 22:52:14 +0000 |
| Subject: | Re: trimming or just getting only numbers from column | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27713@lists.php.net to get a copy of this message | ||
MySQL probably has a trim() function of some kind.
You could also use type-casting in PHP to get rid of non-integer data.
http://php.net/manual
http://mysql.org/
----- Original Message -----
From: Siim Einfeldt aka Itpunk <siim_e@pshg.edu.ee>
Newsgroups: php.general
Sent: Tuesday, November 28, 2000 12:16 PM
Subject: [PHP] trimming or just getting only numbers from column
>
> Hi folks
>
> I need to trim the value that I get from mysql. Eg.
> SELECT *,trim(substring(pikkus,1,3)) as pik FROM viewall...but this one
> doesn`t trim it. How could I do it the way it would work as well?
>
> Another way that migth help me, is just to get only numberic values out of
> substring(pikkus,1,3) and then even the spaces should not be
> included. How?
>
> I`ll be waiting for your ideas.
>
>
> Thanks
> Siim Einfeldt
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>