Jump to content
cosmin

Extract domains+emails who has hosting but not domains administration

Recommended Posts

Hi!

I'm searching for an ideea how to extract in a .csv/.txt a list of .tld domains name plus customer emails if they has no administration domains at me, have only the hosting.

I'm sure with php+mysql can be easy made, if you know php+mysql 😄

Also maybe with a phpmyadmin query is possible.

Many thanks!

Edited by cosmin

Share this post


Link to post
Share on other sites

a starting point could be the SQL query in the thread below...

as is, it wouldn't give you client email addresses, so it would need a join to tblclients where tblclients.id = tbldomains.userid to get the email field.

if you also needed the specific TLD rather than the full domain, then that would require additional coding as the TLD isn't stored separately in the database tables, so it would need to be extracted from the domain value.

Share this post


Link to post
Share on other sites

Hi Brian and many thanks!

The .tld is not so important.
Can you tell me please exactly how can I exctract the customer's email for every domain? ☺️

Thanks again!

Share this post


Link to post
Share on other sites
1 hour ago, cosmin said:

Can you tell me please exactly how can I extract the customer's email for every domain?

I assume you mean from the result of the query (as opposed to just ALL domains)...

SELECT DISTINCT tbldomains.domain, tblclients.email
FROM tbldomains
INNER JOIN tblclients ON tbldomains.userid = tblclients.id,
tblhosting
WHERE tbldomains.domain NOT IN ((SELECT domain from tblhosting))

the above should give you domain & email address of every domain that is in tbldomains that is not in tblhosting, e.g domains that do not have hosting.

if you wanted the opposite, e.g hosting domains that are not in tbldomains (e.g they're managed by the client or another company), then you could use...

SELECT DISTINCT tblhosting.domain, tblclients.email
FROM tblhosting
INNER JOIN tblclients ON tblhosting.userid = tblclients.id,
tbldomains
WHERE tblhosting.domain NOT IN ((SELECT domain from tbldomains))

my suspicion is that you might need to add more where statements to fine tune the results, because as it's currently written, it will find results of all statuses, including cancelled and terminated.

Edited by brian!

Share this post


Link to post
Share on other sites

I added  AND tblhosting.domainstatus='Active'; at the end and is perfect for me.

Many many thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated