Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql query help - if and

Status
Not open for further replies.

paublo

ISP
Sep 14, 2006
127
US
Hi, I have a mysql query that I need help on and hoping someone can give me a hand with this.

currently I have a query that works and the query is:

password_query = SELECT username as user, password, if('%d' IN ('domain1.com', 'domain2.com'), 'quota imap_quota acl imap_acl',null) as userdb_mail_plugins, FROM mailbox WHERE username = '%u'

what I would like to do is have %d be any domain listed (currentl works) but I would also like to have the variable %s be checked if it equals imap.

so if d = domain1.com or domain2.com AND %s = imap pass those values to userdb_mail_plugins otherwise don't.

I would also like to see how "AND NOT %s = imap" query.

thanks so much

paul

 
i think i got it.

password_query = SELECT username as user, password, \
if('%d' IN ('domain1.com', 'domain2.com') AND '%s'='imap',


or

password_query = SELECT username as user, password, \
if('%d' IN ('domain1.com', 'domain2.com') AND '%s'!='imap'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top