[sork] Setting up Vacation with custom SQL driver

Jan Schneider jan at horde.org
Mon Nov 29 09:13:06 UTC 2010


Zitat von Sebastian Feltel <feltel at rahn-schulen.de>:

> Hello Jan
>
> Am 28.11.2010 14:49, schrieb Jan Schneider:
>
>> \U is *not* the email address, it's the full user name. If your user
>> names don't contain a domain part, \u and \U are the same, and \D is
>> empty.
>
> Okay, so I must construct the needed values with a bunch of mysql
> queries. Am I able to execute two or more statements at once while
> enabling or disabling the vacation? Like this:
>
>
> DELETE FROM system.vacation WHERE vacation.email = (SELECT email FROM
> system.postfix_users WHERE username LIKE \u) AND vacation.active = '1';
> DELECT FROM system.postfix_virtual WHERE email LIKE (SELECT email FROM
> system.postfix_users WHERE username LIKE \u);
>
>
> Setting the queries this way leads to an MySQL error in the horde log.

No, this is not possible.

>>> Any help or hint is highly appreciated. :-)
>>
>> Use CONCAT():
>> INSERT into TABLE (username, email, foo, bar) VALUES (\U, CONCAT(\U,
>> '@domain'), fooval, barvar);
>
>
> Thanks for the hint. :-)
>
> Regards,
> Sebastian
> --
> Sork mailing list - Join the hunt: http://horde.org/bounties/#sork
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: sork-unsubscribe at lists.horde.org
>



Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the sork mailing list