nikos Posted May 16, 2008 Share Posted May 16, 2008 Could someone please tell me what line of code should i enter in order to show in support center index page the total number of domains registered (plus trasnfered) within our company? 0 Quote Link to comment Share on other sites More sharing options...
nikos Posted May 18, 2008 Author Share Posted May 18, 2008 Anyone can help in that? 0 Quote Link to comment Share on other sites More sharing options...
Iceman Posted May 19, 2008 Share Posted May 19, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
nikos Posted June 7, 2008 Author Share Posted June 7, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
Iceman Posted June 7, 2008 Share Posted June 7, 2008 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! 0 Quote Link to comment Share on other sites More sharing options...
Iceman Posted June 7, 2008 Share Posted June 7, 2008 Actually, the above will show cancelled and pending domains as well.... so do this instead.... lol SELECT count(domain) FROM `tbldomains` WHERE status="Active" 0 Quote Link to comment Share on other sites More sharing options...
Iceman Posted June 7, 2008 Share Posted June 7, 2008 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... 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 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.