Skip to Content Skip to Menu

CB Query Field, insert query?

  • ospaorg
  • ospaorg
  • OFFLINE
  • Posts: 48
  • Thanks: 18
  • Karma: 1
5 years 9 months ago #309580 by ospaorg
CB Query Field, insert query? was created by ospaorg
Is there a way to use CB Query to insert into a database?
I have been using CB Query to pull from a custom table (one to many relationship, multiple rows per user ID) successfully for some time and found it helpful. We have been populating this custom table using MS Access via ODBC connection but it is fairly clunky; I would prefer to use a web based solution to do so. I originally did not go with the comprofiler table due to the multiple records per user (like an educational transcript)

Here is the query I'm currently using in CB Query to pull the desired data and display in a CB Query field: I would like to insert using a similar method:

SELECT `completion_date`,`biennium`
FROM `zzz_mce_completion`
WHERE `user_id` = '[user_id]';

If CB Query (or other CB plugins) are not designed to do this, do you know of any other solutions that would do custom table inserts (I saw Alter reports suggested in one of your other posts)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48437
  • Thanks: 8275
  • Karma: 1443
5 years 9 months ago #309591 by krileon
Replied by krileon on topic CB Query Field, insert query?

Is there a way to use CB Query to insert into a database?

Nope, it's for pulling data and not inserting data.

If CB Query (or other CB plugins) are not designed to do this, do you know of any other solutions that would do custom table inserts (I saw Alter reports suggested in one of your other posts)

You could use CB Auto Actions to push data in multiple ways. For example you could use a Query action on the after user update trigger to execute a query when the user updates their profile. The Query action can work with internal and external databases as well. There's also the Code action if you need to use PHP. If you need to make an HTTP request you can use the Request 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum