title: Having some trouble with a mysql query pulling data from multiple tables... logic question
body: <p>Ill try to keep this simple and to the point. Essentially I have a news feed, and a comments section. The comments section has two tiers: responses and then replies to responses. Basically structured like so for a given news post: </p>
  
  <pre><code> -&gt; comment
  
   ---&gt; reply
  
   ---&gt; reply
  </code></pre>
  
  <p>Each comment can have multiple replies. Obviously, the WRONG way to do this is to do an SQL query for every comment to check for replies and list them out. <strong>EDIT</strong> Comments only have 1 tier of replies, ie replies CANNOT have replies. - Thanks JohnP</p>
  
  <p>My Questions for this kind of query: </p>
  
  <p>Should I keep the comments and replies in separate tables and use a JOIN, or can I keep the replies and comments in the same table and use a qualifier to separate the type?</p>
  
  <p>Should I attempt to sort them using the query or pull all the data into an array and sort &amp; display that way?</p>
  
  <p>My table currently is as follow:</p>
  
  <pre><code>ID (unique, auto increment)
  NEWS_ID (ties the comment to a particular news post)
  REPLY_ID (ties the comment to a parent comment if it is a reply to another comment)
  USER_ID
  BODY
  PUBLISHED_DATE
  </code></pre>
  
  <p>Any suggestions from those wiser than me would be greatly appreciated! Im still in the very early stages of fully understanding JOINS and other higher level mysql query structures. (IE: I suck at mysql, but im learning :)</p>