This is an example MYSQL result
+----+---+ | A | B | +----+---+ | 1 | 1 | | 1 | 2 | | 2 | 3 | | 2 | 4 | | 3 | 5 | +----+---+
I would like to run through every distinct in Column A and do something utilizing the values in Column B.
Let’s say A has userids and B has foods. I would like to grab all the foods that user 1 likes and then shoot an email to 1, then grab all the foods that user 2 likes and email to her, and so forth. Would appreciate any suggestions.
If you want comma separated values, you can use
GROUP_CONCATOther Link