CB Query

4 years 3 months ago #315916 by varst
CB Query was created by varst
Hi!

I bought a plugin CB Query.
I created a query in field 'cb_kool'
SELECT ( `cb_tootaja_ruhm` / `cb_teinetooandja_arv` ) FROM `kark15_comprofiler` WHERE `id` = '[user_id]'
The request is executed and the result is displayed in the user field.
But I need the result to be saved to the database in a table 'kark15_comprofiler'

Please help me.

Please Log in to join the conversation.

4 years 3 months ago #315936 by krileon
Replied by krileon on topic CB Query
A query field does not save anything to database. Its purpose is to display the results of your SQL and nothing more. If you need to push the value to the database you'll need something like CB Auto Actions to do that. Why do you need the query result saved in the database?


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.

4 years 3 months ago #315938 by varst
Replied by varst on topic CB Query
Hi!
I need it because another table use this value.

Please Log in to join the conversation.

4 years 3 months ago #315940 by krileon
Replied by krileon on topic CB Query
Another table from where? For what? Is your other usage not able to take those 2 existing values and divide them as you're doing in query field? At any rate you won't be able to store them without something to push the values to the database and for that you'll need CB Auto Actions, which typically just pushes the query fields value to another field as its value (e.g. set a text field to the result of a query field using a field auto action).


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.

4 years 3 months ago #315943 by varst
Replied by varst on topic CB Query
Another table from fabrik. I thought that CB Query stored data also in the CB table.

Please Log in to join the conversation.

4 years 3 months ago #315953 by krileon
Replied by krileon on topic CB Query

Another table from fabrik.

Best I can suggest is see if Fabrik can do the math for you if it has some sort of SQL fieldtype. Aside from that you'd need CB Auto Actions to push the query result to a different table. I suppose you could have a query select fieldtype and have only 1 dropdown option available (the results of your query), but that's a bit strange to have a dropdown with a single value.

I thought that CB Query stored data also in the CB table.

It can with a query select fieldtype, but that just uses your custom SQL to determine the dropdown options available for selection; it does not display the results of a custom query. Beyond that am unsure where you got that impression as the first sentence of the plugins description is quite clear with "Lets you grab data using a database query and display results as a CB 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.190 seconds