Current Path : /var/www/html/social/ |
|
Current File : /var/www/html/social/testpage.php |
<? require "../inc/session.php";
include "../connection/connection.php";
$showfrndgelleryquery = mysql_query("select friends_id from social_userfriends where user_id = '".$_SESSION['userid']."' and userfriendsstatus ='1'");
$showfrndgellerarr = array();
while($showfrndgelleryqueryrows = mysql_fetch_array($showfrndgelleryquery,MYSQL_ASSOC)){
array_push($showfrndgellerarr,$showfrndgelleryqueryrows['friends_id']);
}
$userfrndsids = join(',',$showfrndgellerarr);
$userfrndsforchallenge=mysql_query("select user_fullname,user_id,user_img from social_userbasicinfo where user_id in($userfrndsids)");
$arr12 =array();$arr22 =array();
while($challarr = mysql_fetch_array($userfrndsforchallenge,MYSQL_ASSOC)){
array_push($arr12,$challarr['user_id']);
array_push($arr22,$challarr['user_fullname']);
}
$finalarray = array_combine($arr12,$arr22);
$demo = array();
$return = '[';
foreach ($finalarray as $key => $value) {
$arr = array('key' => (string) $key, 'value' => $value);
array_push($demo, json_encode($arr));
}
$return.=implode(',', $demo);
$return.=']';
echo $return;
?>
,