Retrieving data all rows where specific user_id is present?

solidcrowbar

New Member
I am working on a user profile page, and I have made it to where a user can post text and that will be uploaded to the "posts" database. That all works fine. But now I want to make it to where if a user goes to a users profile, it will echo out all their user posts. The database is laid out this way: \[code\]post_id\[/code\] \[code\]user_id\[/code\] \[code\]content\[/code\]And I want to make it to where when a user lands on a user's page it grabs their $user_id and then forms a mysql_query and then echos out all of their posts that are present in the \[code\]users\[/code\] database. What would be the best way to do this? ThanksSo far I have tried this:\[code\]mysql_result("SELECT * FROM posts WHERE user_id = $user_id");\[/code\]
 
Back
Top