Skip to Content Skip to Menu

CB Query field: Display information from a table.

  • GUEST
9 years 8 months ago #259938 by
I added a query field to the profile page.
The query is: SELECT `field1`,`field1` FROM `mytable` where 'ID'=[userid]

Only the field ttle is displayed. I tried multiple permutations of the syntax, but I could not find any information of the CB query field to construct the query.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
9 years 8 months ago #259968 by krileon
Your substitution isn't valid and it's missing quotes so if there's no result your query will error. Your select is selecting multiple columns instead of a single column so unless you've configured it for multiple column display your results may not be as expected. Please see the below example query structure.

Code:
SELECT `field1` FROM `#__mytable` WHERE `id` = '[user_id]'

I recommend searching the forums for additional usages, our tutorials below, and Nicks videos below.

Tutorials: www.joomlapolis.com/support/tutorials
Videos: www.youtube.com/playlist?list=PLp0puRITgC7MM9iP9FooKB1qk8f5MLWVp


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.

  • GUEST
9 years 8 months ago #260017 by
I got the query to work and see the (single value) list in the user profile. How can I get a list with radio buttons to choose one for further action?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
9 years 8 months ago #260050 by krileon
You'd need to use a Query Radio fieldtype. Please see the below that examples how to make a country field using Query Select fieldtype. It's basically the same concept except different fieldtype.

www.joomlapolis.com/support/tutorials/107-use-cases/18377-configuring-a-country-field-with-cb-query-field-plugin


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.

  • GUEST
9 years 8 months ago #260081 by
Sample works. Thank you. Is there a way to show the selection dialog on the profile page when you are not in edit mode? That's what I was looking for, but I may have to write custom HTML for it, which I try to avoid.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
9 years 8 months ago #260093 by krileon
You'll need to install CB Core Fields Ajax and make the field ajax editable.


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