title: Displaying entries per category in ExpressionEngine
body: <p>So, I've searched, and found a few posts that kinda get me what I want, but it still doesn't quite work. This post especially seemed closest to what I was trying to achieve, and I built my code off of it: <a href="http://expressionengine.com/forums/viewthread/168142/" rel="noreferrer">http://expressionengine.com/forums/viewthread/168142/</a></p>
  
  <p>To explain; I have a series of entries, each entry is assigned to only one category. I'd like to list out these categories and, beneath each category, list out the entries with one of their custom fields. Like so:</p>
  
  <ul>
  <li><p>Category 1</p>
  
  <ul>
  <li>Item 1</li>
  <li>Item 2</li>
  </ul></li>
  <li><p>Category 2</p>
  
  <ul>
  <li>Item 1</li>
  <li>Item 2</li>
  </ul></li>
  </ul>
  
  <p>So, here's my code as it stands now, which lists out the categories, but doesn't spit out any of the entries at all:</p>
  
  <pre><code>{exp:channel:categories channel="faq-question" style="linear"}
      &lt;section class="faq-category-container closed"&gt;
          &lt;h1 class="faq-category-header"&gt;&lt;a href="#"&gt;{category_name}&lt;/a&gt;&lt;/h1&gt;
          &lt;dl&gt;
      {exp:query sql="
  
          SELECT title, url_title AS urlt, cat_id
  
          FROM exp_channel_titles
  
          NATURAL JOIN exp_category_posts
  
          WHERE channel_id = '7' AND cat_id = '{category_id}'
  
          ORDER BY title ASC"
      }
          {embed="jazz-camp/faq-cat-list" faqlink="{urlt}"}
      {/exp:query}
          &lt;/dl&gt;
      &lt;/section&gt;&lt;!-- end .faq-category --&gt;
  {/exp:channel:categories}
  </code></pre>
  
  <p>And the embedded template it references:</p>
  
  <pre><code>{exp:channel:entries channel="faq-question" url_title="{embed:faqlink}"}&lt;!-- entry --&gt;
      &lt;dt&gt;{title}&lt;/dt&gt;
      &lt;dd&gt;
          {faq_content}
      &lt;/dd&gt;
  {/exp:channel:entries}
  </code></pre>
  
  <p>Any help would be most appreciated!</p>