Basically, Im trying to get a list of groups that a member is part of in an array (excluding a few), and limiting it to certain status in that group. I want all the values returned from the query to go into an array. The problem is, when I do...
$row = $ClubGDC(54);
echo $row[0];
...for example, it returns blank, and when printf-ing it, it is completely empty. So even though the SQL command DOES return values in a database query, this array is empty.
I have no idea if this is even the proper way to do what im trying to do. If someone could please help, it would be much appreciated. The full function is below:
function ClubGDC($userid)
{
$gdcarray = array();
$query = "SELECT * FROM members WHERE access < 300 AND status='Active'";
$query .= "AND group!= 1 AND group!= 234 AND group!= 99999999999 AND group!= 199 AND group!= 228 ";
$query .= "AND id = $userid";
$q = mysql_query($query);
$i2 = 0;
while($row = mysql_fetch_array($q))
{
$gdcarray[0] = $row["group"];
$i2++;
}
return $gdcarray;
}