I guess mine is messed up somehow but you can try it on yours. Add this to the query:
Code:
, ".constant("PREFIX")."users.uid
and this where you want the link to show up:
Code:
<a href='http://www.ratties.x10.mx/forum/member.php?action=profile&uid={$row->uid}'>{$row->username}</a>