Skip to Content Skip to Menu

Assigning a Membership Number

10 years 4 months ago #246503 by RodFarrell
Assigning a Membership Number was created by RodFarrell
I've created a membership site for Jaguar Drivers using Joomla 2.5, CB 1.9 and CBsubs. I've also used Fabrik extensively for reporting and creating additional tables.

I need to assign a membership number automatically to each new subscriber, being the last used membership number plus 1. I'm sure there are a number of ways to do this but would appreciate some direction on what would be the most effective?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246516 by krileon
Replied by krileon on topic Assigning a Membership Number
If it's in the database somewhere you should be able to use CBSubs SQL Actions to perform a database query to grab the highest value for that column and increment it by one. So for example it could be a read only integer field or something of the sort.


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.

10 years 4 months ago #246539 by RodFarrell
Replied by RodFarrell on topic Assigning a Membership Number
Thanks Kyle,

I'm having trouble finding that plugin. Are you referring to CB Query Field?

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 4 months ago #246547 by nant
Replied by nant on topic Assigning a Membership Number

RodFarrell wrote: Thanks Kyle,

I'm having trouble finding that plugin. Are you referring to CB Query Field?


Nope, Kyle mentioned the CBSubs SQL Action - please study your CBSubs manual for this plugin and feature.

It will allow you to execute SQL queries in your database everytime a new subscription starts in your cbsubs plan.

You would need to formulate the proper query to check your membership table and find the largest (assuming membership number is an integer) membership number and the adding 1 to that value and save it for your just subscribed user.

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

10 years 3 months ago - 10 years 3 months ago #246765 by RodFarrell
Replied by RodFarrell on topic Assigning a Membership Number
Thanks Nick, I've found that but the manual says

"Warning: This plugin should not be used to alter #__user and/or #__comprofiler
tables, the CBFields integration plugin should be used to alter CB Field values
(stored in #__comprofiler table)." so its no good for this purpose.

OK, I've achieved what I needed by setting the user ID to the last member number and retrieving the new user id into the Member Number field with CBFields Integration.

I still have another task that requires running a mysql query to retrieve data from another (non cb) table and populating a CB field with it. Which plugin do we use for that?
Last edit: 10 years 3 months ago by RodFarrell.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #246831 by krileon
Replied by krileon on topic Assigning a Membership Number

I still have another task that requires running a mysql query to retrieve data from another (non cb) table and populating a CB field with it. Which plugin do we use for that?

Depends on when you want the query to happen. If it's meant to happen on subscription then you'd also use CBSubs SQL Actions. If you want it to happen on profile update and registration then CB Auto Actions and its Query action works best. An alternative is to not move data at all and just display the information you want on the users profile using CB Query Field, which displays database query results as a CB 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