hey,
i have made a gd image from my database, and it works fine appart from one part...
the code get info for a certain user and puts it in the image, but i want it to display top 12 friends...
example

Here is the code i tried, it displays 12 friends in different positions by using the array, but the problem is it displays the same friend 12 times...
and i need it to not display some, if say the user only has 5 friends then it only shows 5
$a = array(25, 55, 85, 115, 145, 175, 205, 235, 265, 295, 325, 355);
foreach($a as &$row){
//you don't have to do anything here
}
unset ($row); // it is safe now to use $row again
foreach($a as $row){
$sql11="SELECT accessid FROM users WHERE username='".$userPart[0]."'";
$result11 = mysql_query($sql11);
while($row11 = mysql_fetch_array($result11))
{
$sql12="SELECT friend FROM friends WHERE user='".$row11['accessid']."' AND accepted='yes' LIMIT 0, 12";
$result12 = mysql_query($sql12);
while($row12 = mysql_fetch_array($result12))
{
$sql13="SELECT accessid FROM users WHERE accessid='".$row12['friend']."' LIMIT 0, 1";
$result13 = mysql_query($sql13);
while($row13 = mysql_fetch_array($result13))
{
$userImg = imagecreatefrompng( '../images/dp/'.$row13['accessid'].'/me.png' );
$userImgHeight = imagesx( $userImg );
$userImgWidth = imagesy( $userImg );
// Copy
imagecopyresized($my_img, $userImg, $row, 95, 0, 0, 25, 25, $userImgWidth, $userImgHeight);
}
}
}
}
thanks for any help.