Re: [Exim] lookup mysql and {yes}{no}

Etusivu
Poista viesti
Vastaa
Lähettäjä: Peter Bowyer
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [Exim] lookup mysql and {yes}{no}
jmab@??? said:
> hello,
> according to the docs :
> ${if <condition> {yes}{no} }
> will return 'yes' if the condition is true and 'no' if the condition
> fails.
>
> why does this work the opposite way when i do a mysql lookup:
> ${if <mysql lookup> {yes}{no} } ?
>
> I have to use:
> ${if <mysql lookup> {no}{yes} } so that when the SELECT query returns
> non-null if matches 'yes'.


You're getting conditions and lookups confused.

${lookup mysql {<some sql>} {yes}{no}}

will return yes if the sql query succeeded (ie returned something) and no
if it didn't. That's probably all you need.

Peter