The below code returns 4 images from 4 users with there user ID's being 22905,2,13,17396,
The problem is instead of showing in this order 22905,2,13,17396 it keeps showing un numeric order from smallest to largest and I need it to show in the order it is saved in teh DB as
so 22905,2,13,17396 is showing up as 2,13,17396,22905 and I really need it as 22905,2,13,17396
<?PHP
// we pull this from DB, I have it here for testing purposes
$line_member['topfriendslist'] = '22905,2,13,17396';
//this returns the value associated with these userid's 22905,2,13,17396
$sql_frienduser = 'select auto_id,disp_name,pic_url from friend_reg_user where status="Active" and auto_id in (' .$line_member['topfriendslist']. ')';
$result_frienduser = executequery($sql_frienduser);
//we have 4 matches above so now we cycyle through them and show there images
for ($_top = 0; $_top < 4; $_top++){
if ($line_frienduser = mysql_fetch_array($result_frienduser)) {
// build image
$height = 70;
$width = 80;
if($line_frienduser['pic_url'] != ''){
$img_name = $line_frienduser['pic_url'];
$file = "uploded_files/userphoto/" . $img_name;
$fil_ext1 = pathinfo($file);
$fil_ext = $fil_ext1["extension"];
$fil_explode = '.' . $fil_ext;
$arr = explode($fil_explode, $img_name);
$img_name = $arr[0] . "_thumb1" . $fil_explode;
}else{
$img_name = 'nopic.gif';
}
echo '<img src="uploded_files/userphoto/' .$img_name. '" border=0>';
}
}
?>