Skip to Content Skip to Menu

CB Query Field

  • webaholic
  • webaholic
  • OFFLINE
  • Posts: 17
  • Thanks: 2
  • Karma: 0
7 years 1 month ago #298074 by webaholic
CB Query Field was created by webaholic
hi,

I just bought the QueryField plugin, I did a test to copy a field in another:

1. on my 'drop down_single' field I add the UPDATE query, the request that copies the selection to another field; in 'integration' part of 'drop/down(unique)' selection (cb_thisfield) , I activated the Query Validation :

UPDATE `#_comprofiler` SET `cb_field` = `cb_thisfield`


But when I edit a user to change the selection of the fields (for testing), the copy is done on other users but not on the one I edited / saved and closed (I purged the cache, refresh.. but nada with the one I edited )


Thank you in advance for your answer

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
7 years 1 month ago #298088 by krileon
Replied by krileon on topic CB Query Field
CB Query Field is for SELECT queries. It is not for updating anything. If you want to update on various criteria you need CB Auto Actions and its Query action. CB Query Field simply displays the results of an SQL query, it can validate a field based off an SQL query, or build a dropdown list of options based off an SQL query. In no usecase should you be performing an update query from CB Query 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.

  • webaholic
  • webaholic
  • OFFLINE
  • Posts: 17
  • Thanks: 2
  • Karma: 0
7 years 1 month ago #298099 by webaholic
Replied by webaholic on topic CB Query Field
damn! I bought the wrong plugin :dry:

However, you and nant, advised me to buy the 2 plugins including this one,

Kyle mentioned:
CB Query Field:
www.joomlapolis.com/addons/cb-query-field
and CB Code Field:
www.joomlapolis.com/addons/cb-code-field


i think you are familiar with my pb now , I can not afford to buy all the plugins :(
so please, are you sure that the one you just mentioned

CB Auto Actions

will do the job????


:huh: So.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
7 years 1 month ago #298103 by krileon
Replied by krileon on topic CB Query Field
You were advised below that you can query for or use PHP to parse out the last value of a multiselect or multicheckbox field using CB Query Field (SQL) or CB Code Field (PHP). What you're trying to do is not that. You are trying to COPY the entire value of 1 field to another in which case you were advised you would need CB Auto Actions to do (or possibly need both CB Auto Actions and CB Query/Code Field). This is all stated below in your topic.

www.joomlapolis.com/forum/146-general/237533-copy-record-fields?start=12#298072

Use the below query to do what you're wanting in a Query fieldtype to extract the last value of a multiselect or multicheckbox field. No this won't copy it and it won't be stored in the database. It'll be visible on their profile and that's it (it can not be searched either).

Code:
SELECT SUBSTRING_INDEX( `cb_thisfield`, '|*|', -1 ) FROM `#__comprofiler` 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: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum