Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User deleted
(deleted) Sun 09-Jul-06 17:49:34
Print Post

mysql query help


[link to this post]
 
trying to setup dovecot at the moment and wondering why the following syntax is not working:

SELECT maildir as home, uid, gid FROM domains WHERE domain = 'darktech.or
g.uk';

returns:

+---------------------------------+-----+-----+
| home | uid | gid |
+---------------------------------+-----+-----+
| /usr/local/mail/darktech.org.uk | 90 | 90 |
+---------------------------------+-----+-----+


what iam trying to get is /usr/local/mail/darktech.org.uk/username as a returned answer, which possibly means combing two variables in the syntax but i have no idea how to do that.

SELECT maildir||''admin' as home, uid, gid FROM domains WHERE domain = 'darktech.org.uk'

i tried this, and this gets me a return of '0' from the home field.

anyone got any other ideas? how hard can it be to get the result of select MAILDIR and add /admin to the end?
Standard User deleted
(deleted) Sun 09-Jul-06 18:09:56
Print Post

update


[re: deleted] [link to this post]
 
got it. for anyone else with same issue:

SELECT concat(maildir, '/%n') as home, uid, gid FROM domains WHERE domain = '%d';
  Print Thread

Jump to