Creating an Auto membership No

14 years 3 weeks ago #130592 by JWNZ
Creating an Auto membership No was created by JWNZ
I'm running Cb 1.21 (will upgrade to 1.22 this week) and CB Subs 1.03 and I'm trying to figure out how i can get this system to automatically assign a membership number at regsitration.
We already have 90 members on the site and want to move from an excel record to keeping everything in the Cb database. I can obviously put in the values manually but I would rather have the system do this so i really need a solution that looks at the highest number in the field and add 1. That way I can manually fill in the existing member nos and then add new ones.
Any thoughts?

Please Log in to join the conversation.

14 years 3 weeks ago #130603 by nant
Replied by nant on topic Re:Creating an Auto membership No
each user is automatically assigned a user_id value.

You can see this value in the CB User management backend (right column).

You can show this value in frontend by using a delimiter field with [user_id] in it.

Please Log in to join the conversation.

14 years 3 weeks ago #130604 by krileon
Replied by krileon on topic Re:Creating an Auto membership No
Best approach is to develop a query to meet your needs then place it within your plan using CBSubs SQL Actions. The following is an example that might accomplish your needs (please make changes as necessary).

You will first need to create an integer field within CB Field Management. Remember its name as well as you'll need it for the query (for sake of example lets called it cb_integer).

[code:1]
UPDATE `#__comprofiler` SET `cb_integer` = ( ( SELECT `cb_integer` FROM `#__comprofiler` ORDER BY `cb_integer` DESC LIMIT 1 ) + 1 ) WHERE `id` = [user_id]
[/code:1]

This would at least allow more customized approach, but Nicks solution is by far the easiest (and likely most efficient) as each user is truly created with a unique number for user_id.

Post edited by: krileon, at: 2010/04/19 14:34


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.197 seconds

Facebook Twitter LinkedIn