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 #247851 by joseat
Replied by joseat on topic DBlookup function to final of register
HI Krileon:

I did not understand, I explain better:

I have a database table naming "CLIENTS" with flollowing structure:
CODE_RUC varchar(13)
NAME_RUC varchar(50)

In my CB Form, I input in one field any RUC value, as "0909207524001". With this value, and using the mySQL command SELECT, I want select the field "NAME_RUC" of the table CLIENTS and store this field value into any variable.

How do I perform this task?
Exist any plugin for do it?
If YES, what is and please, send me the steps for get it the above requirement.

I used some of the plugins that I bought and I also had to hack the code CB QUERYFIELD to achieve what I just explained, but I could only show the value of the field but I could not be stored in the table. I do not understand OOP programming. But I must assume that there is any other better solution.

Thank you so much for your cooperation.

JOSE ALVARADO
Multimedia Designer.

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 - 10 years 2 months ago #247882 by krileon
Replied by krileon on topic DBlookup function to final of register
The storing is done by the field you're using. In your case just create a Text field then use Query Validation for it. When the user registers and the query validation passes then the value the user entered will store. It can't store NAME_RUC, but what you can do is have a field for the user to supply the CODE_RUC, which validates it using Query Validation. Next create a normal Query Field, which displays the results of the query as a normal field to query for NAME_RUC. Example usage as follows.


Field 1
Type: Text
Name: cb_code_ruc
Query Validation: Enabled
Query:
Code:
SELECT * FROM `#__clients` WHERE `code_ruc` = '[value]'
Mode: Internal
Validate On: Successful Results
Validate Error: Invalid token provided!
Ajax Validation: Enabled

Field 2
Type: Query
Name: cb_name_ruc
Query:
Code:
SELECT `name_ruc` FROM `#__clients` WHERE `code_ruc` = '[cb_code_ruc]'


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.
Last edit: 10 years 2 months ago by krileon.

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 #247946 by joseat
Replied by joseat on topic DBlookup function to final of register
Dear Krileon:

I did everything you suggested, but the Query field in step 2 only performs a query but that kind of field is not shown.

How do I display the result of SELECT during registration?

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 #247953 by krileon
Replied by krileon on topic DBlookup function to final of register

How do I display the result of SELECT during registration?

You can't, CB Query Field has no edit display so it can't display on registration or profile edit. Registration especially as it has no user information to use in the query.


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 #247957 by joseat
Replied by joseat on topic DBlookup function to final of register
Thanks for your collaboration. But I have a question.

In a above post, you mention this: "Next create a normal Query Field, which displays the results of the query as a normal field to query for NAME_RUC. Example usage as follows." and in the last post you say that don´t do it.

Question:
why should I apply what the Query field if I can not show?

This step already did. Please, give me one last suggestion to conclude this post.

thank you

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 #248004 by krileon
Replied by krileon on topic DBlookup function to final of register

and in the last post you say that don´t do it.

I apologize for the confusion. That step is meant for Profile View. It will allow you to display the name you've stored in the database instead of the code. It can not display on registration or profile edit, it's just for Profile View.


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