I want to join 2 tables together but i cant get it to work.
These are the tables:
threads: id, title
posts: thread_id, message
$sql = mysql_query("SELECT threads.id, threads.title
FROM threads
JOIN posts ON posts.thread_id = threads.id
WHERE threads.id = ".intval($_GET['id']));
while ($post = mysql_fetch_assoc($sql))
{
echo $post['title'];
echo $post['message'];
}
It gets the title but not the message. I have one assigned to the thread.