My code is this:
<?php
    $user=$_SESSION['username'];
    $avatar="SELECT us_avatar FROM all_users WHERE user_nick=?";
    $query=$bd->prepare($avatar);
    $query->bind_param('s',$user);
    $query->execute();
    $query->bind_result($img);
    $query->fetch();
echo '<img src="'.$img.'" alt="" />';
?>
The error is - Fatal error: Call to a member function bind_param() on a non-object in i've checked does avatar is reserved keyword but it isn't. I've tried "SELECT us_avatar FROM all_users WHERE user_nick=?" but it doesn't work. Name of the field and the table are the same as in the db. That bug is coming after update, if i don't do the update it run well.
