Skip to Content Skip to Menu

[SOLVED] UPDATE Database Fields

  • zapatista
  • zapatista
  • OFFLINE
  • Posts: 28
  • Thanks: 0
  • Karma: 0
12 years 5 months ago #200266 by zapatista
Replied by zapatista on topic Re: UPDATE Database Fields
I can imagine that the solution is not that difficult. But I'm still not on it.
Please describe to me in detail how CB makes changes in the profile, if I change the language or time zone. CB changes the data in the user-table of Joomla. That's exactly what I need - not in the user table, but in a different table, which is called #__person.
Since I can nowhere find a detailed documentation about Auto Actions, I need a step by step instructions.
I also have the problem that I do not know if I should somehow connect it with fields.
Excuse me, but I've only been working a short time with CB. For this reason, I have a pro-membership, because I knew that it is difficult at first.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago - 12 years 5 months ago #200268 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
I've explained to you how to do this twice now, I will not repeat that same explanation again; please read my previous replies. The user parameters field is a CB field, it doesn't work off a trigger; it's a field designed to display and process certain data and I suppose you could create a new fieldtype plugin (see existing fieldtype plugins such as the Gravatar or Video incubator projects). Another example as follows.

Type: Query
Triggers: onAfterUserUpdate
User: Automatic
Access: Everybody
Query:
Code:
UPDATE `#__person` SET `position_id` = '[cb_position]' WHERE `user_id` = '[user_id]'


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: 12 years 5 months ago by krileon.
The following user(s) said Thank You: zapatista

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

  • zapatista
  • zapatista
  • OFFLINE
  • Posts: 28
  • Thanks: 0
  • Karma: 0
12 years 5 months ago #200473 by zapatista
Replied by zapatista on topic Re: UPDATE Database Fields
Great, I've done. Thank you.
Now I would like to do a simple SELECT query with "Auto Actions". The output field is cb_positionfrontend and intended only to illustrate the result when somebody read the profile.

Regards
Christian

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200506 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
To do that you can use incubator project CB Query Field. You supply a SELECT query and it displays the results as a field.


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.

  • zapatista
  • zapatista
  • OFFLINE
  • Posts: 28
  • Thanks: 0
  • Karma: 0
12 years 5 months ago #200536 by zapatista
Replied by zapatista on topic Re: UPDATE Database Fields
OK, I've already tried. However, I do not get a result if I use global variables, such as [userid]:
Code:
SELECT name FROM #__users WHERE id = [userid]

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200548 by krileon
Replied by krileon on topic Re: UPDATE Database Fields
[userid] is not a valid substitution. Please see the below example.
Code:
SELECT `name` FROM `#__users` WHERE `id` = '[user_id]'


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: zapatista

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

Moderators: beatnantkrileon
Powered by Kunena Forum