Query field vs Code field

8 years 2 months ago #278223 by edmundcheong
Query field vs Code field was created by edmundcheong
What is the difference between radio/droplist/multicheck code field and radio/droplist/multicheck query field?

When would be the best to use which?

Please Log in to join the conversation.

8 years 2 months ago #278237 by krileon
Replied by krileon on topic Query field vs Code field
Query field is database queries. Code field is PHP code. Two entirely different languages and usages. The query select fieldtypes generate their options from your database query. The code select fieldtypes generate their options based off the return value of your custom PHP code.

When would be the best to use which?

I don't know. They're tools. There's no clear cut "where do I use this" scenario. It's 100% dependent on your needs. Maybe you need a dropdown with options that come from a 3rd party extensions API so you'd need PHP and in that case a code select field would do that.


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

Please Log in to join the conversation.

8 years 2 months ago - 8 years 2 months ago #278281 by edmundcheong
Replied by edmundcheong on topic Query field vs Code field
Technically with the code field plugin, i would be able to query from Oracle using some php codes to connect to Oracle?

Please Log in to join the conversation.

8 years 2 months ago #278295 by krileon
Replied by krileon on topic Query field vs Code field
Yup, you can execute whatever PHP you want. Substitutions are supported Joomla/CB APIs can also be used. In addition to that you've access to the $field and $user objects.


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.246 seconds

Facebook Twitter LinkedIn