Thanks again, Kyle. You're awesome for taking the time to expand on this.
The reason I was going to find a workaround was that I'm not very 'seasoned' at MySQL queries - So this helps. Except for one thing...
When I put
SELECT GROUP_CONCAT( `id` SEPARATOR '\n' )
FROM `jos_groupjive_groups`
WHERE `user_id` = '[user_id]'
GROUP BY `user_id`
into the query field, it changes the \n's. So I pasted it into my editor first in order to strip anything that came from this page, then pasted it in and I still get an SQL error:
It's still stripping just the 'n' out like below and I'm getting an SQL error...
SELECT GROUP_CONCAT( `id` SEPARATOR '\
' )
FROM `jos_groupjive_groups`
WHERE `user_id` = '[user_id]'
GROUP BY `user_id`
I'm guessing that's why I'm getting this error:
1146 - Table 'tommiet_talentcom.jos_groupjive_groups' doesn't exist SQL=SELECT GROUP_CONCAT( `id` SEPARATOR '\ ' ) FROM `jos_groupjive_groups` WHERE `user_id` = '381' GROUP BY `user_id`
I took a look at the database and noticed that the typical _jos prefix is _netu9 on this installation of Joomla and changed it in the query. This cancelled the error. I turned on 'show empty fields' in the configuration and it just shows a dash (-).
The 'n' is still stripped out so maybe this is now the reason for it showing no results. Is there a way to keep CB from stripping anything out of the SQL?
I took another look at the database and found something. The user id in the database for that table is just the user who created the group... in my case, the administrator created all of them. So I signed in on the front end as the admin and it does work, but not line separated.
So, I guess my question in the end is... is there no way to pull groups that the user has joined (only that the user created)?
It's not working due to your table prefix not being jos_. It should be #__ in the query so it auto replaces. I've edited my original reply with the query fixed. Please try the below.
Code:
SELECT GROUP_CONCAT( `id` SEPARATOR '\n' )
FROM `#__groupjive_groups`
WHERE `user_id` = '[user_id]'
GROUP BY `user_id`
The linebreak is just being replaced on error display and that's ok. Just make sure the results of the query field display on profile as expected and the condition should work ok.
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.
I've actually solved that (noted in last post) by replacing with the correct table prefix. I tried it with #__, but get the same result. Not line-separated and only works to show groups created by the user... not groups joined by that user. Hope that makes sense.
Only when logged in as administrator, I get:
Query Field:
16 10 9 8 15 14 13 12 11 17
Note please see the regex in the attached file as forum security doesn't seam to like the pattern.
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.