I'm trying to create a table of users that are part of a group but I can't seem to get it working. The list is stored in a column so that each userid # is separated by a "~". For example, if users 1,2 and 3 are attending the column would show "1~2~3". This is what I use explode for.
I'm getting the following error "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in" which is for the line where $friend is defined.
$attendingUsers = mysql_query("Select acceptedInvites from events where eventID = ".$_GET['eventID']." ");
while($friend = mysql_fetch_array($attendingUsers)){
$users = $friend['acceptedInvites'];
$userExplode = explode("~",$users);
for($i=0; $i<count($userExplode);$i++){
echo $userExplode[$i]; //displays the userid number properly so I know this is working
$friendInfo = mysql_query("select (userid,username) from users where userid = '". $userExplode[$i]."' ");;
$friend = mysql_fetch_array($friendInfo);
echo '<table><tr><td><a href="profile.php?userid=' . $friend['userid'] . '">' . $friend['username'] . '</a></td>';
}
}
I'm starting to think it's something to do with $friendInfo because when I echo it nothing is displayed (usually would say array).