Please note, I am a beginner with all of this.
I am trying to select all the group ids of which a user_id attached to.
so the table I am querying has structure of:
group_id | user_id
currently it just grabs one group ID where the user ID is attached.
here is my query:
$ID = $_SESSION['myuserid'];
$get_group = mysql_query("SELECT group_id FROM group_association_tb WHERE user_id = $ID");
$groups = mysql_fetch_assoc($get_group);
regards,
$get_groupis a MySql result set, so you will need to loop through it to get all thegroup_identries:now the
$groupsarray will hold all of your group ids.