wc_r Posted February 28, 2009 Share Posted February 28, 2009 Apparently the inactive status for clients is if they have never logged in. Well, I have over 1200 clients listed as inactive, but some of them have active hosting or domain accounts. They were imported from WHM, but they never have needed to log in. I need a little script written ( will pay), unless one exists, that does this - From tblclients, check all users marked as status inactive against tbldomains and tblhosting. For tbldomains, see if they have a domain marked 'active' or 'pending' in the 'status' and in tblhosting check if they have 'active' or 'pending' in 'domainstatus' column. If any of the inactive accounts have active or pending domains or hosting, mark the client 'active' in tblclients. Wish my mysql knowledge was better! 0 Quote Link to comment Share on other sites More sharing options...
BobsRe Posted February 28, 2009 Share Posted February 28, 2009 I can get this to you in a moment. 0 Quote Link to comment Share on other sites More sharing options...
BobsRe Posted February 28, 2009 Share Posted February 28, 2009 You can download the file at http://www.bobsresources.com/Projects/. I need a little script written ( will pay) I will not charge but I would appreciate a donation. 0 Quote Link to comment Share on other sites More sharing options...
BobsRe Posted February 28, 2009 Share Posted February 28, 2009 Also let me know how it works out for you and please backup your database, as It is not extensively tested. 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted February 28, 2009 Share Posted February 28, 2009 Looked at the coding, looks fine, should do exactly what he needs. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted March 1, 2009 Share Posted March 1, 2009 or do it with 3 simple lines of sql ... update tblclients set =inactive where =active update tblclients set =active where id in (select id from tbdomains where status=active) update tblclients set =active where id in (select id from tbhosting where domainstatus=active) 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted March 1, 2009 Share Posted March 1, 2009 I'm trying to accomplish the opposite: I want to set domains and hosting accounts to cancelled where clients = Closed. I'm doing this for tbldomains but I'm getting a syntax error: update tbdomains set = Cancelled where id in (select id from tblclients where status = Closed); What's wrong here? TIA 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted March 2, 2009 Share Posted March 2, 2009 set = Cancelled needs to be set <fieldname>="Cancelled" although that wont actually cancel their hosting - you'd be better just getting the list of the clients where status ="Closed" and manually killing all their products ... 0 Quote Link to comment Share on other sites More sharing options...
Patty Posted March 2, 2009 Share Posted March 2, 2009 set = Cancelled needs to be set <fieldname>="Cancelled" although that wont actually cancel their hosting - you'd be better just getting the list of the clients where status ="Closed" and manually killing all their products ... Thank you. That's what I ended up doing. 0 Quote Link to comment Share on other sites More sharing options...
wc_r Posted March 2, 2009 Author Share Posted March 2, 2009 Also let me know how it works out for you and please backup your database, as It is not extensively tested. Well, I uploaded it and tried it, but it didn't work. This is the output - Changed 0 clients to Active of the 2 clients that were Inactive. 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 2, 2009 Share Posted March 2, 2009 Use phpmyadmin and run the SQL queries that othellotech has provided 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.