Du skal bruge en JOIN for at bringe de to borde sammen på det matchende felt, så noget som:
$sql = "SELECT p.body, p.stamp, u.username FROM posts p INNER JOIN users u ON p.user_id=u.user_id WHERE p.user_id='$userid' ORDER BY p.stamp DESC";
Du skal bruge en JOIN for at bringe de to borde sammen på det matchende felt, så noget som:
$sql = "SELECT p.body, p.stamp, u.username FROM posts p INNER JOIN users u ON p.user_id=u.user_id WHERE p.user_id='$userid' ORDER BY p.stamp DESC";