I've never used PDO so I'm probably not going to be able to help you but let me think out loud for a moment.
The error message seems to say that execute is not a method on $sth_user - or that $sth_user isn't even an object. But that can't be right because back in lines 1-2, you were able to call execute() on the $sth object.
But I do notice that you are preparing a simple SQL statement that should be accepting a single scalar variable (an integer).
SELECT * FROM staff_details where staff_id = ?
That SQL statement should take a number. But you are passing it an array when you call this:
execute(array($row->id))
So I am going to guess that you should call this instead:
execute($row->id)
If that works, then great... except that it contradicts the problem stated in the error message.