Skip to Content Skip to Menu

"user_id" appears as record in query drop down (single select) table

  • cliffvt
  • cliffvt
  • OFFLINE
  • Posts: 180
  • Thanks: 27
  • Karma: 6
9 years 1 month ago - 9 years 1 month ago #272088 by cliffvt
Hi There

I created a query drop down (single select field) to return a list of active users - however the first record shows as blank (expected) the second as "user_id" (unexpected) and the user list follows.

Could you please be so kind as to let me know what I may be doing wrong here?

My query is:
Code:
SELECT `name`, `block`, `id` FROM `#__users` WHERE block=0 ORDER BY name

Using CB 2.0.l1

Thanks
Cliff
Last edit: 9 years 1 month ago by cliffvt.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
9 years 1 month ago #272122 by krileon
You need to specify what column value and label should use under Options tab. Example as follows.

Query:
Code:
SELECT u.`id`, u.`name` FROM `#__users` u JOIN `#__comprofiler` ue ON ue.`id` = u.`id` WHERE u.`block` = 0 AND ue.`approved` = 1 AND ue.`confirmed` = 1 AND ue.`banned` = 0 ORDER BY u.`name` ASC
Value Column: id
Label Column: name


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