http://www.w3schools.com/sql/sql_join_inner.asp
Combine the statuses table with the friendships table and use a WHERE clause to determine if they are friends.
PuTTY does not show password input to prevent people who are looking at your screen from knowing how long your password is. It's a security feature on lots of applications that use SSH.
That doesn't help. We won't know what it's referencing if we can't see the line that is throwing the error. At this point it could be a lot of things...
$user may not be an object or could be empty. run var_dump() on that or give print_r() output on the query to see if it's returning the...
I know exactly what it means, I'm wondering why you are even using it when it is utterly useless. All you need is.
echo $user;
Your method would only be necessary if you were echoing plaintext before the variable.