Skip to Content Skip to Menu

DBlookup function to final of register

  • joseat
  • joseat
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
10 years 2 months ago #247607 by joseat
I bought the professional membership, $150, because I need to validate than the input code exist in the table of database, prior to input the remain register fields. Then, continue to registration form. Otherwise, come back to homepage of my site.

But in the register form I should input the all fields and press the register button, for the validation function. I really want than the validation to realize first, and depending of resultant value, continue with the next fields or abort the register.

How do I for get this?

Of before hand,

Very thanks,
JOSE ALVARADO

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago #247627 by krileon
Replied by krileon on topic DBlookup function to final of register
You want to validate that the value they input into a field exists in the database before letting them register? If my assumption is correct then yes this is doable. You'll need to use CB Query Field and its Query Validation and a Text Field for example. Example usage of CB Query Field and its Query Validation can be found below.

www.joomlapolis.com/forum/153-professional-member-support/223186-solved-qsecuredq-registration?start=6#235806


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.
The following user(s) said Thank You: joseat

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

  • joseat
  • joseat
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
10 years 2 months ago #247630 by joseat
Replied by joseat on topic DBlookup function to final of register
Thanks Krileon.

Effectively, that is exact. I input in query field SELECT * FROM 'dgmd_clienteruc' WHERE ruc_cli='[value]', how testing if this evaluate to TRUE. Please show me the steps to achieve it. I´m stressed because since I bought the tool I can not even solve the problem.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago #247632 by krileon
Replied by krileon on topic DBlookup function to final of register
The below will probably work.

Query Validation: Enabled
Query:
Code:
SELECT * FROM `#__clienteruc` WHERE `ruc_cli` = '[value]'
Mode: Internal
Validate On: Successful Results
Validate Error: Invalid token provided!
Ajax Validation: Enabled

The above will validate if there is a match. I don't know your database structure so you may need to adjust the query. If you've any further issues please carefully review the link I provided above as it details a working example (including the database table).


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.

  • joseat
  • joseat
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
10 years 2 months ago #247633 by joseat
Replied by joseat on topic DBlookup function to final of register
Hi Krileon:

I created the text field and activate the query and function perfect.
Now, when already validated the query field RUC and evaluate a TRUE, continue to the form.

But before, how I show the description of the field RUC, only show, without input any data?

The SQL sentences SELECT don´t support query from 2 tables.
Please tell me any clue.

Thanks,

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 2 months ago #247770 by krileon
Replied by krileon on topic DBlookup function to final of register
You want to test the value against 2 database tables? That's possible. Just do a JOIN to merge the two tables together for your select query. Example as follows.

Code:
SELECT * FROM `#__table1` AS t1 INNER JOIN `#__table2` AS t2 WHERE t1.`col` = '[value]' AND t2.`col` = '[value]'


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