Jump to content

total number of domains in client area


nikos

Recommended Posts

You need to lookup/count all items in the table "tbldomains" for the "userid".

 

The following query on the db will list all domains for clientid 1001

SELECT * FROM `tbldomains` WHERE userid=1001

 

Cheers,

Paul

Link to comment
Share on other sites

  • 3 weeks later...

Hi Paul, thank you for your answer.

How about the total number of domains registered by all clients?

I d like everyone (clients and visitors), when they go to whmcs index page to see this statistic.

Link to comment
Share on other sites

Even simpler :)

SELECT * FROM `tbldomains`

If you only want the "domain" field rather than all the other fields try using this:

SELECT domain FROM `tbldomains`

 

 

Although to count the ACTIVE domains so you only have a NUMBER there would be a better and simpler way of doing it. Haven't looked at that though.

 

You would need to only COUNT all domains that have type=Transfer or type=Register.

eg (but this will only list the domain names it doesn't give you a total number)

SELECT domain FROM `tbldomains` WHERE type="Transfer" OR type="Register" 

 

 

Cheers,

Paul

 

----------------------------------

EDIT: lol easy to do !!!! Try this :)

 

SELECT count(*) FROM `tbldomains`

or

SELECT count(domain) FROM `tbldomains` WHERE type="Transfer" OR type="Register"

 

Cheers!

Link to comment
Share on other sites

And to show NUMBER of EXPIRED domains....

 

SELECT count(domain) FROM `tbldomains` WHERE status="Expired"

 

To show NUMBER of CANCELLED domains...

SELECT count(domain) FROM `tbldomains` WHERE status="Cancelled"

 

 

 

 

And while I'm on a roll... :lol:

to show the NUMBER of ACTIVE CLIENTS...

SELECT count(id) FROM `tblclients` WHERE status="Active"

Although I don't suggest showing that to your clients :lol:

Link to comment
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