I have 03 tables with relationship
jos_session
+userid
jos_gj_user
+id_user
+id_group
jos_gj_jb
+group_id
+category_id
I AM WANT TO COUNT user in table jos_session base on category_id in table jos_gj_jb
This is what I am trying
SELECT COUNT(s.userid)
FROM jos_session s
WHERE s.user.id IN (SELECT id_user
FROM jos_gj_user
WHERE id_group(SELECT group_id FROM jos_gj_jb WHERE category_id= .$variable.))
HOW CAN COUNT user_id for a category_id?