ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
RE: [PHP-DB] Re: IS_NUMERIC ?. .
by Martin Norland other posts by this author
Nov 29 2005 12:07PM messages near this date
[PHP-DB] Kathy A Wright/CORP/Keane is out of the office. | RE: [PHP-DB] Re: IS_NUMERIC ? [SOLVED]
>  -----Original Message-----
>  From: El Bekko [mailto:elbekko@[...].com] 
>  
>  http://php.belnet.be/manual/en/function.is-numeric.php
>  
>  Apparently there is :)
>  
>  
>  Dwight Altman wrote:
>  > Hello List,
>  > Is there an IS_NUMERIC(aCandidateString) function in MySQL that I
can run in
>  > a query, similar to the various PHP "is_*" functions?  I can't seem
to find
>  > it in the docs (other than a C API IS_NUM macro).
>  > 
>  > I have a field in a database with serial numbers like:
>  > ...1234
>  > ...1235
>  > ...1236-A
>  > ...1237B
>  > and I want to get the last 4 characters of the numeric substring
like so:
[snip]

Last I checked, MySQL doesn't support PHP functions natively :)

His question was whether there's an equivalent function to that in
MySQL, and I agree with a previous answer, you can use a REGEXP (
http://dev.mysql.com/doc/refman/4.1/en/regexp.html ) if there is nothing
else available.

(example - randomly scrounged together)
REGEXP '^.*[:digit:]{4}.[^:digit:]*$'    ( {1,4} if you want the last
group of up to 4 digits)

cheers,
- Martin Norland, Sys Admin / Database / Web Developer, International
Outreach x3257

The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Martin Norland
Dwight Altman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved