$sql = \"select body, stamp from posts where user_id = \'$userid\' order by stamp desc\";
NOTE: the above query works fine. What I want to do is also s
Try this:
select body, stamp, username from posts p JOIN users a ON p.user_id = a.user_id WHERE p.user_id = '$userid' order by stamp desc