I have a problem selecting 6 random friends
This is the query I\'ve got so far:
$result = num_rows(\"SELECT * FROM friends WHERE member_id = \'\".$_S
First select the number of friends that the user has:
"SELECT COUNT(*) as numFriends FROM friends WHERE member_id='".$_SESSION['userid']."'
...put that into a variable, let's call it "$numFriends" Then:
for($z=0;$z<6;$z++) { $randomFriendIndex = rand(1,$numFriends); //Get the friend at that index }