Jump to content

function bugging out.


Eggzorcist

Recommended Posts

Hey everyone.

 

For some reason, one of my function does not display what it is supposed to and even outside the function after it has been called any echo's after it won't be echoe'd.

 

Here is my function:

 

function friendsList($id){

$query = $dbh->prepare("SELECT users.id, users.fb_id, users.fb_pic, users.fn
		FROM users
            INNER JOIN friendlist ON users.fb_id = friendlist.friend2 
            WHERE friendlist.friend1 = ? AND friendlist.status = 1");

$query->bindValue(1, $id);
$query->execute();

$friendNum = $query->rowCount();
$friendList = $query->fetchAll(PDO::FETCH_ASSOC);

$output = "";
foreach($friendList as $row){
		$output .= "<img src ='". $row['users.fb_pic']. "alt = '". $row['users.fn'] ."' />  ";
		$output .= $row['users.fn']. "</br>";
}

return $output;
}

 

Could it be my MAMP server? I don't get any PHP errors and have looked numerous times throughout this function to find nothing out of the ordinary.

 

Thanks for the headsup

Link to comment
https://forums.phpfreaks.com/topic/267602-function-bugging-out/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.