|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: mouss (mlist.only
free.fr)
Date: Tue Sep 04 2007 - 05:16:41 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dick Middleton wrote:
> Victor Duchovni wrote:
>> On Mon, Sep 03, 2007 at 10:32:48AM +0100, Dick Middleton wrote:
>
>>> For better or worse I'm trying to setup mysql to do helo checks
>>> on a country basis. I've got a table set up with the tld as the
>>> "key" and query it like this:
>>>
>>> query = SELECT helo FROM country WHERE code = '%1'
>
>> Sorry, the "%n" macros are not designed for domain-only lookup keys.
>
> Well, that's a bummer :-(
>
> Luckily mysql seems to be able to do the job but I hate to think how
> many cpu cycles it uses.
>
> query = SELECT helo FROM country WHERE '%s' RLIKE CONCAT('\\.', code,'$')
>
no need for REGEXP.
query = SELECT helo FROM country WHERE
substring_index('%s', '.', -1) = code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]