Danke!
I was going about it wrong. I was trying to do the whole thing in PHP. I had completely forgotten about the exp:query tag!.. 
Anyway, for the archives - usage:
<?php
global $SESS;
$member_id = $SESS->userdata['member_id'];
?>
{exp:query sql="SELECT avatar_filename, avatar_width, avatar_height FROM exp_members WHERE member_id = <?php echo $member_id; ?>"}
<img src="http://www.streetdoc.net/images/avatars/{avatar_filename}" width="{avatar_width}" height="{avatar_height}">
{/exp:query}
A little something for the Wiki maybe??