HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   Getting the client email starting from the domain_id (http://www.howtoforge.com/forums/showthread.php?t=59357)

vaio1 2nd November 2012 15:14

Getting the client email starting from the domain_id
 
Hi Guys,

how have I to get the client's email stating from the domain_id value?

thanks

Croydon 2nd November 2012 15:50

Could you please be a bit more precise in what you want to do?

vaio1 2nd November 2012 16:14

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?

thanks

till 2nd November 2012 16:18

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.

Croydon 2nd November 2012 16:27

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.


All times are GMT +2. The time now is 04:07.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.