Auteur: Johansson Jan Datum: Aan: 'Philip Hazel' CC: 'exim-users@exim.org' Onderwerp: RE: [Exim] mysql Lookup problem?
>What your message said you used was this line:
>select if(count(*), "1", "0) from passwd where id='$local_part@$domain'
>Is that actually correct? If so, the problem is a missing " after "0
No, that was the original posters version, i added the missing " in my
tests/my reply.
>1. It got long enough as it is!
Granted.
>2. I am not an SQL user, and know very little about it. Consequently,
>such examples as there are are very simple. Indeed, from this thread I
>have now learned that you can do things like
Oh, no, i didnt mean "SQL specific". And i KNOW the info is in the book, i
have found it. I was more inclined towards stuff like, p 103, it explains
how the condition works, but i cant really find a referens to "what other
operators are availabl".
And, no, i definitely couldnt have written it better myself, so i will be
quiet.
>select if(count(*), "1", "0") from passwd where id='$local_part@$domain'
>which I presume means 'yield "1" if a record is found, and "0" if no
>record is found'. I rather suspected the query language could do fancy
>stuff like that, which makes the use of "condition" a lot tidier. People
>have been using messier constructions like
>
>${lookup mysql {select id from passwd where id='$local_part@$domain'}{1}{0}}
Yeah, mySQL is turning into a clever little thing, give it decent
transaction support, and it will be rockin' all night long.. So to speak.
Regards, Jan.
And, yes i do like the book, it has made my life easier, and is getting
rather thumbed already.