I'm having an issue querying multiple values from rows that have a certain value. I use the SQL code below to grab column "group_id"'s values if the "id" equals 999. In the "xx_groupmap" table, the id 999 shows up three times with different values. Below is my table.
table xx_groupmap
-------------------
id | group_id
-------------------
999 | 2
999 | 7
999 | 8
Below is the code I use
$db = JFactory::getDbo();
$query = "SELECT group_id FROM xx_groupmap WHERE id = '999'";
$db->setQuery($query);
$results = $db->loadObjectList();
foreach ($results as $t) {
}
So in the end when I want to return the three values of id 999 I use this code
echo $t->group_id;
but it only outputs one number. How do I build an array with the three values from id 999?