hi i am trying to call the Persons() from the user_friends() to get the data for the users it can grab 1 array but when its a multiple array i get this 1111ttTTdd1111110011ee00pp22ttUUPP1111iiSSWWRRii2211HHBB

can some one help me please.

<?php



class profile {





    

     // Get Person   	

	public function Persons($uid) 

	{
                foreach($uid as $i)

                {
                      $id=$i['friend'];

	              $query = "SELECT * FROM afa_users WHERE user_id='$id'";
	              $command = mysql_query ($query);
	              $profile = mysql_fetch_array ($command);

		}
	              $data=$profile;

	       return $data;

        }

	

	//Get Persons Friends

       public function user_friends($uid) 

       {
	    $query = mysql_query("SELECT * FROM afa_friends WHERE user='$uid' ORDER BY user DESC") or die(mysql_error());

                while($row=mysql_fetch_array($query))
                {
                      $uids[]=$row;
                      $person = $this->Persons($uids);
                      $person=array($person);
               return array_pop($person);
                }

	}



    



}



?>

i have tried looping it and mysql while() but just get the same can some one help please :)

ok got it to stop outputting: 1111ttTTdd1111110011ee00pp22ttUUPP1111iiSSWWRRii2211HHBB

but still cant get multiple users from the persons function :(

<?php



class profile {





    

     // Get Person   	

	public function persons($uid) 

	{
                foreach($uid as $i)

                {
                      $id=$i['user'];

	              $query = "SELECT * FROM afa_users WHERE user_id='$id'";
	              $command = mysql_query ($query);
	              $profile = mysql_fetch_array ($command);
	              $data[]=$profile;

		}

	       return $data;

        }

	

	//Get Persons Friends

       public function user_friends($uid) 

       {
	    $query = mysql_query("SELECT * FROM afa_friends WHERE friend='$uid' ORDER BY id DESC") or die(mysql_error());

                while($row=mysql_fetch_array($query))
                {
                      $uids[]=$row;
                      $person = $this->persons($uids);
                      $person=array($person);
               return array_pop($person);
                }

	}



    



}



?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.