Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

User List - Advanced Sorting

  • sirweb
  • sirweb
  • ONLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
8 years 11 months ago #273313 by sirweb
Replied by sirweb on topic User List - Advanced Sorting

krileon wrote: Please provide the full error message.

Code:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT fv.`ordering` FROM `#__comprofiler_field_values` WHERE fv.`fieldvaluei' at line 8 SQL=SELECT DISTINCT ue.*, u.*, '' AS 'NA' FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND g.group_id IN (6, 7, 2, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 3, 4, 5, 56) AND ( `cb_loge` ='45' AND `cb_befattning` >'""' AND `cb_typ` ='1' ) ORDER BY SELECT fv.`ordering` FROM `#__comprofiler_field_values` WHERE fv.`fieldvalueid` = SUBSTRING_INDEX( ue.`FIELD_NAME`, '|*|', 1 ) LIMIT 0, 500
(I have replaced the DB prefix with '#_')

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
8 years 11 months ago #273320 by krileon
Replied by krileon on topic User List - Advanced Sorting
Ok, please try the below.

Code:
( SELECT fv.`ordering` FROM `#__comprofiler_field_values` AS fv WHERE fv.`fieldvalueid` = SUBSTRING_INDEX( ue.`FIELD_NAME`, '|*|', 1 ) )


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.

  • sirweb
  • sirweb
  • ONLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
8 years 11 months ago #273419 by sirweb
Replied by sirweb on topic User List - Advanced Sorting
Sorry, Another error occured.
Code:
1054 Unknown column 'ue.FIELD_NAME' in 'where clause' SQL=SELECT DISTINCT ue.*, u.*, '' AS 'NA' FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND g.group_id IN (6, 7, 2, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 3, 4, 5, 56) AND ( `cb_loge` ='45' AND `cb_befattning` >'""' AND `cb_typ` ='1' ) ORDER BY ( SELECT fv.`ordering` FROM `#__comprofiler_field_values` AS fv WHERE fv.`fieldvalueid` = SUBSTRING_INDEX( ue.`FIELD_NAME`, '|*|', 1 ) ) LIMIT 0, 500

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
8 years 11 months ago #273427 by nant
Replied by nant on topic User List - Advanced Sorting

shultman wrote: Sorry, Another error occured.

Code:
1054 Unknown column 'ue.FIELD_NAME' in 'where clause' SQL=SELECT DISTINCT ue.*, u.*, '' AS 'NA' FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND g.group_id IN (6, 7, 2, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 3, 4, 5, 56) AND ( `cb_loge` ='45' AND `cb_befattning` >'""' AND `cb_typ` ='1' ) ORDER BY ( SELECT fv.`ordering` FROM `#__comprofiler_field_values` AS fv WHERE fv.`fieldvalueid` = SUBSTRING_INDEX( ue.`FIELD_NAME`, '|*|', 1 ) ) LIMIT 0, 500


Please do not just copy paste.

The ue.FIELD_NAME should be replaced with your specific field name.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum