$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
$sql = "SELECT p.body,p.stamp,u.username from posts p LEFT JOIN users as u ON (p.user_id = u.user_id) WHERE user_id = '$user_id' ORDER BY p.stamp DESC";
should do it