I have sql data as follows:
+++++++++++++++++++++++++++++++++
+ id name group +
+ 1 cs1 1,2 +
+ 2 cs2 1,3 +
+ 3 cs3 2,3 +
+++++++++++++++++++++++++++++++++
What I wanted is to select the names for every group which is represented by group IDs in the group column. I have searched so much but can't figure out how to get the data for each group using PHP.
I want the output to be:
++++++++++++++++++++++++++++++++
+group members +
+ 1 cs1 +
+ cs2 +
+ 2 cs2 +
+ cs3 +
+ 3 cs2 +
+ cs3 +
++++++++++++++++++++++++++++++++
or
$group1 = array (cs1, cs2);
Your valuable insights are highly appreciated.
Thank you.