[SOLVED] UPDATE Database Fields

12 years 1 week ago - 11 years 11 months ago #200052 by zapatista
[SOLVED] UPDATE Database Fields was created by zapatista
Hi all,

I try in this forum because I can no longer answers on Incubator-Forum - Server Error!?!?

I would like to present in the CB profiles a field from another table (third-party component). In addition, should be the field from the user modifiable. I'm not quite sure if I do this with "Auto Actions". Maybe there is somewhere prime examples - then I could make it easier to derive.

Best regards
Christian dam

Please Log in to join the conversation.

12 years 1 week ago #200058 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
As the table you're wanting to query is a Joomla component it would be in the same database so you'd be able to use CB Auto Actions query action to query that database for a value then update a field with that value. Example as follows.
UPDATE `#__comprofiler` SET `cb_myfield` = ( SELECT `title` FROM `#__mycomponent` WHERE `user_id` = '[user_id]' ) WHERE `id` = '[user_id]'

Please understand this is just an example and is not functional. Please review carefully and make whatever changes you may need to make.


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.

12 years 4 days ago #200228 by zapatista
Replied by zapatista on topic Re: UPDATE Database Fields
Thank you for that. But the field does not appear when I want to change my profile. How can I actually insert a field with auto action in a tab?

In the default settings you have "select language" or fields, such as "time zone". There you can also select from a pull-down menu a predefined value. So I would like to have it too. Just not on the table # __users, but from another table.

This table is called __ person and the column is called __ position_id (value = 1 to 4). This value should the user get listed in a pull-down menu. And this must then be stored in the table __ person.

The simple SELECT query is easy to implement. I still fail however to the possibility to make that value changeable in the "Update Profile"-area.

Regards
Christian

Please Log in to join the conversation.

12 years 4 days ago #200232 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
You're wanting to insert into the _person database table? Sorry, I don't understand what you're trying to do. Please review the below MYSQL documentation. Please review to my signature regarding custom code, sorry; I can't code everything for everyone. If you need MYSQL help you may want to hire an SQL professional to write the queries for you.

dev.mysql.com/doc/refman/5.6/en/index.html


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.

12 years 4 days ago #200242 by zapatista
Replied by zapatista on topic Re: UPDATE Database Fields
Obviously we do not understand us. Maybe it's because Google Translate ...

I know how to use mySQL. Unfortunately, I do not know exactly how I do this with "CB Auto Actions" to transpose.

Why I want to solve it, is not up for discussion. The user will get an opportunity to change the value of another table (with a pull-down menu). There are these possibilities already (time zone, language), I do not know why the problem is not obvious.

Please Log in to join the conversation.

12 years 4 days ago #200252 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
Use CB Auto Actions with a Query action using the after profile update trigger. Then write your query as you normally would. It'd then fire that query everytime they update their profile.


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.188 seconds

Facebook Twitter LinkedIn