title: Wordpress: Custom loop to sort posts by month... Need help extracting post_content.. wpdb
body: <p>I am trying writing a loop to display posts by month. It has gone fairly well so far, i just need help extracting the post_content from the DB. I has successfully gotten all of the rest of the post info using wpdb.
  I have tried post_content just like post_title but it doesn't work. </p>
  
  <p>here is the example page i am working on.
  <a href="http://asg.websolutionshack.com/events/" rel="nofollow">http://asg.websolutionshack.com/events/</a></p>
  
  <pre><code>&lt;div id="events" class="full"&gt;`
   &lt;?php 
  </code></pre>
  
  <p><code>$months = $wpdb-&gt;get_results("SELECT DISTINCT MONTH(post_date) AS month , YEAR(post_date) AS year FROM $wpdb-&gt;posts WHERE post_status = 'publish' and post_date &lt;&gt; now() and post_type = 'event' GROUP BY month, year ORDER BY post_date DESC");
    $posts = $wpdb-&gt;get_results("SELECT id, post_title, post_content, MONTH(post_date) AS month , YEAR(post_date) AS year , DAY(post_date) AS day FROM $wpdb-&gt;posts WHERE post_status = 'publish' and post_type = 'event' ORDER BY post_date DESC");
    foreach($months as $this_month){ ?&gt;</code></p>
  
  <pre><code>&lt;div class="month_block"&gt;
  &lt;h2 class="month"&gt;&lt;?php echo date("F", mktime(0, 0, 0, $this_month-&gt;month, 1, $this_month-&gt;year)); ?&gt; &lt;?php //echo $this_month-&gt;year; ?&gt;&lt;/h2&gt;
  &lt;?php for ($i = 0; $i &lt;= count($posts); $i++){?&gt;`
  
  &lt;div class="entry"&gt; 
    &lt;?php if(($this_month-&gt;year == $posts[$i]-&gt;year)&amp;&amp;($this_month-&gt;month == $posts[$i]-&gt;month)){?&gt;
    &lt;span&gt;&lt;?php echo $posts[$i]-&gt;month ?&gt;.&lt;?php echo $posts[$i]-&gt;day ?&gt;.&lt;?php echo $posts[$i]-&gt;year ?&gt;&lt;/span&gt;&lt;h3&gt;&lt;?php echo $posts[$i]-&gt;post_title; ?&gt;&lt;/h3&gt;
     &lt;p&gt;&lt;&lt;?php echo $posts[$i]-&gt;post_content; ?&gt;&lt;a href="&lt;?php echo get_permalink($posts[$i]-&gt;id); ?&gt;"&gt;Details &gt;&lt;/a&gt;&lt;/p&gt;
    &lt;?php } ?&gt;
  &lt;/div&gt;&lt;!-- entry --&gt;
  &lt;?php } ?&gt;
  &lt;/div&gt;&lt;!-- month --&gt;
  </code></pre>
  
  <p><br>
  `</p>
  
  <p>Thank you for any insight you might be able to provide me.</p>