I am using Dreamweaver and MAMP to create a site. I have a table called posts inside I have two columns, postid, and userid. I'm putting all the posts on a page and I want to show which user posted which post, and write that on each post respectively. For example the first post that should show up has a postid of 2 and a userid of 1. Currently it is displaying the userid of the user who is logged in on all the posts, I am using:
mysql_select_db($database_akaearthdb, $akaearthdb);
$query_PostsUserid = "SELECT userid FROM posts WHERE posts.userid ORDER BY posts.postid";
$row_PostsUserid = mysql_fetch_assoc($PostsUserid);
and
echo $row_PostsUserid['userid']
To display it. I want $row_PostsUserid['userid'] to be the userid of the person who posted it.
Let me know if you need any more information, I'm new to the language so sorry if I'm doing everything wrong, TIA.