|
|
![]() |
|
|
Top | #1 |
|
Godlike!
Joined: February 2004
Location: Birmingham, UK
Posts: 6,818
Blog Entries: 5
Reputation: 3651
Power: 179 |
Hey!
Anyone know if I can have mysql 5 arbitrarily prefix a value from a table in a select statement? I had thought that something like: Code:
SELECT CONCAT('maildir:',pop) AS home FROM users WHERE username = "email@domain.com"
Pointers in the right direction would be appreciated
|
|
|
|
|
|
|
|
|
Top | #2 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,854
Reputation: 1490
Power: 190 |
I too would also expect that to work.
you tried it with the email address in single quotes? a good way to test it would be to try SELECT CONCAT('maildir:', pop) AS home FROM users; |
|
|
|
|
|
|
|
|
Top | #3 |
|
Debiant by way of Ubuntu
Joined: August 2002
Location: London, UK
Posts: 3,758
Blog Entries: 5
Reputation: 1390
Power: 142 |
there's no chance this is in a php script and you have perhaps ommitted \"maildir:\" is there? The only other thing I can think of that pop is returning as null - in which case the whole finction evaluates to null (you never get just "maildir:" returned, but then I can't see why you would want to either...
|
|
|
|
|
|
|
|
|
Top | #4 |
|
Godlike!
Joined: February 2004
Location: Birmingham, UK
Posts: 6,818
Blog Entries: 5
Reputation: 3651
Power: 179 |
nah not php, configuration for dovecot imap/pop3 server
![]() For the moment I've manually specified a default location for maildir locations, but since that's stored in the database I'd like it to figure it out for itself ![]() However I need to prefix "maildir:" to the value in the database so that insted of /usr/local/mail/domain/user_part_of_full_mail_address/Maildir it gets maildir:/usr/local/mail/domain/user_part_of_full_mail_address/Maildir |
|
|
|
|
|
|
|
|
Top | #5 |
|
Godlike!
Joined: February 2004
Location: Birmingham, UK
Posts: 6,818
Blog Entries: 5
Reputation: 3651
Power: 179 |
Well I don't know what I was doing wrong last night but the following works now:
Code:
SELECT CONCAT('maildir:',pop) AS mail, uid, gid FROM users WHERE username = %u"
My guess is that I was supposed to use mail and not home. But works now
|
|
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++: cant resolve string --> string[] | dubstar | Web Design & Coding | 6 | May 27th, 2007 8:10am |
| Simple Java for statement problem | Scott Young | Web Design & Coding | 3 | February 20th, 2006 11:07pm |
| Privacy Statement | Electronic Punk | News & Information | 0 | March 20th, 2004 2:27am |
| modem string | bluzeboy | Windows Desktop Systems | 2 | November 22nd, 2002 2:49pm |
| modem string | bluzeboy | Windows Desktop Systems | 3 | September 20th, 2002 2:08am |
![]() |