Skip to Content Skip to Menu

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

db lookup

  • Peterx
  • Peterx
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
11 years 2 months ago #232370 by Peterx
db lookup was created by Peterx
Hi I get the following error
Cannot execute Mandatory SQL query check
when the registration form is submitted.
I can't find any documentation on how to configure db lookup (other then the wiki).
Any suggestions/guidance would be appreciated.
Peter

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 2 months ago #232374 by nant
Replied by nant on topic db lookup

Peterx wrote: Hi I get the following error
Cannot execute Mandatory SQL query check
when the registration form is submitted.
I can't find any documentation on how to configure db lookup (other then the wiki).
Any suggestions/guidance would be appreciated.
Peter


and what is the sql code you are trying to execute?

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

  • Peterx
  • Peterx
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
11 years 2 months ago #232416 by Peterx
Replied by Peterx on topic db lookup
SQL query check:
SELECT * FROM `testcodes` WHERE `code`= '[value]' AND `userid` = '0'

I replace [value] with my own value.

That's what is in Community Builder Field: Edit [ Registration Access ]

I am am confused (obviously lol) as to how this all works.
My SQL and programming is poor as I rarely need it .

What I am trying to achieve is this:
I have a site (sentryhealthservices.com) that I just published and it has an employee section that requires registration which is moderated.
I realized that I only want the employess to register and not random individuals out on the internet.
I thought I could provide all 400 employees a single access code that is required to complete the registration form.

Will db_accesscode do this or do i need some customizing?

Thank you
Peter

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 2 months ago #232427 by nant
Replied by nant on topic db lookup

Peterx wrote: SQL query check:
SELECT * FROM `testcodes` WHERE `code`= '[value]' AND `userid` = '0'

I replace [value] with my own value.


Nope - you should not touch the [value] part.
It will automatically be substituted by the value that the user inputs in the field.

That's what is in Community Builder Field: Edit [ Registration Access ]

I am am confused (obviously lol) as to how this all works.
My SQL and programming is poor as I rarely need it .

What I am trying to achieve is this:
I have a site (sentryhealthservices.com) that I just published and it has an employee section that requires registration which is moderated.
I realized that I only want the employess to register and not random individuals out on the internet.
I thought I could provide all 400 employees a single access code that is required to complete the registration form.

Will db_accesscode do this or do i need some customizing?

Thank you
Peter


You can accomplish this with a just a CB text field that you have configured to only validate for the single access code you want.

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

  • Peterx
  • Peterx
  • OFFLINE
  • Posts: 8
  • Thanks: 1
  • Karma: 0
11 years 2 months ago #232543 by Peterx
Replied by Peterx on topic db lookup
How do I do that? I don't see where I enter the unique code.
IS there any documentation/ tutorials /step by step instructions somewhere?. The CB site is lacking documentation as far as I can see.

Thanks for your help
Peter

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 2 months ago #232610 by krileon
Replied by krileon on topic db lookup
Create a text field for them to provide the access code. Then adjust the below parameters on that text field so it only validates for a single value (your access code).

Authorized input: Custom PERL regular expression
Perl Regular Expression: /ACCESS_CODE_HERE/

This will cause the field to only validate for the string you place in "ACCESS_CODE_HERE". This uses REGEX so try to keep the code alphanumeric (e.g. ABC123) to avoid having to escape any characters.

Usage of field validation parameters are outlined in your CB documentation which you can download from the Advanced downloads section.


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