0

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);
                }

	}



    



}



?>
1
Contributor
2
Replies
3
Views
5 Years
Discussion Span
Last Post by cleggy1987
0

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

0

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);
                }

	}



    



}



?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.