Discussion in 'Developers' Forum' started by vaio1, Nov 2, 2012.
how have I to get the client's email stating from the domain_id value?
Could you please be a bit more precise in what you want to do?
Hi again, I need to create a query to get the client email starting from one of his webdomains (domain_id)
So I have to Select email from clients where ??? Join ???
is there a E.R (Entity Relationship Diagram) of ISPConfig?
Most records in ispconfig have a column sys_group_id which define the group a record belongs to and each group is woned by a client. So you can get the client that owns a record by using the sys_group_id of the record that you have, then look up the client_id from sys_group table.
In general there is no direct link (in the database) between ONE web domain and email addresses!
If you want to access a list of emails that MIGHT(!) be connected to a given WEB domain you could try doing a join like this.
SELECT email FROM mail_user INNER JOIN web_domain ON (SUBSTR(email, INSTR(email, '@')+1) = domain) WHERE web_domain.domain_id = 12345
It's not guaranteed to work because of the things I stated above.
Separate names with a comma.