I'm trying to make a Private Message Application. And I need the Inbox to show both "main messages" and "answers on messages".
My tables are as listed:
post
id - header - content - from_user - to_user - receiver_opened - user_bywho - timestamp.
post_answer
id - answer_from_user - answer_to_user - answer_user_bywho - answer_header - answer_content - answer_id - timestamp_svar.
And now I'm having troubles. Because I don't know how to make this possible.
My mysql_query looks like this right now:
$user = $_SESSION['username'];
$sql = mysql_query("SELECT * FROM post,post_answer WHERE ".
"answer_to_user='$user' AND to_user='$user'")
or die(mysql_error());
Thanks in advance.