Possible Duplicate:
SQL SELECT across two tables
I want to build a little forum in php and mysql. I have two tables:
forum_posts: id(Primary_Key),user_id(Foreign_Key),text
and
user: id(Primary_key), username
Now I want to list all forum posts and to each post I want to display the author.
My try:
$mySQL_getPosts = mysql_query('SELECT * FROM forum_posts ORDER BY id ASC');
This of course gives me just all posts. But How do I make a connection to my user table?
In the end I want to display a post like this:
Username wrote: | Here goes the text from forum_posts