PHP Matching the output of 2 codes
<p>I need to match the result format of 2 code:</p>

<p>I need to get the output/format of this:</p>

<pre><code>$event_day = $year.'-'.$month.'-'.$list_day;  // $event_day
</code></pre>

<p>match this:</p>

<pre><code>DATE_FORMAT(date,'%Y-%m-%d')
</code></pre>

<p>Full code:</p>

<pre><code>$query = "
  SELECT title, DATE_FORMAT(date,'%Y-%m-%d') AS date 
  FROM table 
  WHERE user_id = '$session_user_id' 
    AND date BETWEEN '$year-$month-1' AND '" . date("Y-m-t", strtotime("$year-$month-1")) . "' 
    AND active = 1";
</code></pre>

<p>My problem is that $event_day is only displaying events for: October, November and December.</p>

<p>I had a similar problem with this code below:</p>

<pre><code>$query = "
  SELECT title, DATE_FORMAT(date,'%Y-%m-%d') AS date 
  FROM table 
  WHERE user_id = '$session_user_id' 
    AND date LIKE '$year-$month%' 
    AND active = 1";
</code></pre>

<p>and it was fixed with this code:</p>

<pre><code>$query = "
  SELECT title, DATE_FORMAT(date,'%Y-%m-%d') AS date 
  FROM table 
  WHERE user_id = '$session_user_id' 
    AND date BETWEEN '$year-$month-1' AND '" . date("Y-m-t", strtotime("$year-$month-1")) . "' 
    AND active = 1";
</code></pre>

<p>Anyone know how I could sort this out?</p>
