I am trying to access the $Frined_Id outside the while loop. But it is only returning the last accessed element. Is there any method so that i can store the value of Friend Id inside the array and then can use them in program whenever i want.
$query="SELECT * FROM `user_friend` WHERE `User_Id`='$id'";
if($query_run=mysql_query($query))
{
$mysql_num_rows=mysql_num_rows($query_run);
$i=$mysql_num_rows;
while($row=mysql_fetch_array($query_run))
{
$Friend_Id=$row['Friend_Id'];
$Name=$row['Friend_Name'];
$Name_array=array("$Name");
echo "<a href=\"view_profile.php?id=$Friend_Id\"/>".$Name."</a>".'<br>';
}
echo $Friend_Id;
}