Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Need help with SQL query

  • beelliott
  • beelliott
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
11 years 5 months ago #227887 by beelliott
Need help with SQL query was created by beelliott
I would like to create secondary accounts based upon family member's active subscription. i.e. Mom has an active subscription. Son wants to have an active account, without having to pay for it. I want a SQL query that will look at son's registration information, which would include mom's username as a look-up field in his profile (parent username).

Currently, I have a main acocunt subscription plan. It has a SQL query that sets expiration on a set date, regardless of start date. So, I also want the child account to go inactive on the same day as the parent's subscription expires.

What we have now is a main account with a subscription plan. Also, there is a second (kids) account with a different subscription plan, that requires moderator approval. We have to manually check the "Parent Username" field and compare it to the parent's username, and check to see if the parent is active, and then turn on the account manually. I want to alleviate the need for a moderator to accomplish this. I'm not very good with SQL queries though.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 5 months ago #227948 by krileon
Replied by krileon on topic Need help with SQL query
Don't add subscriptions through queries. You need to use API to do this. I suggest using CB Auto Actions and its CB Paid Subscriptions 3.x action to give the child account a subscription. It supports conditionals as well so if you have a field that determines they're eligible or not then you'd just condition off of that field.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum