title: Change Date Format on SQL query
body: <p>I am passing some variables through a form (month &amp; year) into an SQL query that displays the results based on a selected month and year. I have a select menu for the month and year. My date time stamp is (yyyy,mm,dd) how can I display the full text of the month when I echo the results rather then a numerical value? Here is my query</p>
  
  <pre><code>        // Query For Contract Items
      if(isset($_GET['month'])){
      $month = $_GET['month'];
      $year = $_GET['year'];
      $ds = (int)$year."-". (int)$month;
      $result = mysql_query("SELECT * FROM projects WHERE  end_date LIKE '$ds%' AND status!='Invoiced' AND status!='Done' AND status!='Delayed' AND billed='Contract' ORDER BY client, start_date DESC");
  
  $result2 = mysql_query("SELECT SUM(amount) * 100 AS sum_ammount FROM projects WHERE end_date LIKE '$ds%' AND status!='Invoiced' AND status!='Done' AND status!='Delayed' AND billed='Contract' ORDER BY client, start_date DESC");
  $information = mysql_fetch_array($result2);
  }
  
  
  &lt;form action="est.php" method="get"&gt;
                            &lt;table width="920" border="0" cellspacing="0" cellpadding="0"&gt;
                              &lt;tr&gt;
                                &lt;td align="left" valign="top"&gt;
                                    &lt;fieldset style="float:left; margin-right:20px;"&gt;
                                     &lt;label&gt;Month&lt;/label&gt;
                                      &lt;select name="month"&gt;
                                      &lt;option value='01' &gt;January&lt;/option&gt;
                                      &lt;option value='02'&gt;February&lt;/option&gt;
                                      &lt;option value='03'&gt;March&lt;/option&gt;
                                      &lt;option value='04'&gt;April&lt;/option&gt;
                                      &lt;option value='05'&gt;May&lt;/option&gt;
                                      &lt;option value='06'&gt;June&lt;/option&gt;
                                      &lt;option value='07'&gt;July&lt;/option&gt;
                                      &lt;option value='08'&gt;August&lt;/option&gt;
                                      &lt;option value='09'&gt;September&lt;/option&gt;
                                      &lt;option value='10'&gt;October&lt;/option&gt;
                                      &lt;option value='11'&gt;November&lt;/option&gt;
                                      &lt;option value='12'&gt;December&lt;/option&gt;
                                    &lt;/select&gt;
                                    &lt;/fieldset&gt;
                                      &lt;fieldset style="float:left; margin-right:20px;"&gt;
                                     &lt;label&gt;Year&lt;/label&gt;
                                     &lt;input type=text name="year" size="4" style="width:100px;" value="&lt;?php echo $year; ?&gt;"&gt;&lt;/fieldset&gt;
                                    &lt;fieldset style="float:left; margin-right:20px;"&gt;
                                    &lt;input type="submit" style="margin-top:16px;" value="Crunch Numbers"&gt;
                                    &lt;/fieldset&gt;
        &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
        &lt;/form&gt;
    &lt;div style="clear:both"&gt;&lt;/div&gt;
  
  
  &lt;h3&gt;&lt;?php echo $month; ?&gt; / &lt;?php echo $year; ?&gt; Contract&lt;/h3&gt;
  &lt;table id="myTable" class="tablesorter" cellpadding="0" cellspacing="0"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th width="10%"&gt;Client&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Project&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Designer&lt;/th&gt;
  
                      &lt;th width="5%"&gt;Start Date&lt;/th&gt;
  
                      &lt;th width="5%"&gt;End Date&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Time&lt;/th&gt;
  
                      &lt;th width="10%"&gt;&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
  
              &lt;tbody&gt;
  
  
  
              &lt;?php
                              while ($row = mysql_fetch_assoc($result)) {
  
                                                                  $id = $row['id'];
                                                                  $client = $row['client'];
                                                                  $title = $row['title'];
                                                                  $assigned = $row['assigned'];
                                                                  $start_date = date('F d, Y', strtotime($row['start_date']));
                                                                  $end_date = date('F d, Y', strtotime($row['end_date']));
                                                                  $status = $row['status'];
                                                                  $amount = $row['amount'];
                                                                  $billed = $row['billed'];
  
                                                          ?&gt;
  
  
  
                              &lt;?php 
  
                              $x++; 
  
                              $class = ($x%2 == 0)? 'whiteBackground': 'graybackground';
  
                              echo "&lt;tr class=\"$class\"&gt;";
  
                              ?&gt;
  
  
                      &lt;td width="10%"&gt;&lt;strong&gt;&lt;span class="sentanceCase"&gt;&lt;?php echo $client; ?&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;
  
                      &lt;td width="10%"&gt;&lt;?php echo $title; ?&gt;&lt;br/&gt;
  
                     &lt;span class="gray"&gt;&lt;?php echo $billed; ?&gt;&lt;/span&gt;
  
                     &lt;span class="hours"&gt;...............................&lt;/span&gt;&lt;br /&gt;
                     &lt;?php echo $status; ?&gt;
  
                     &lt;/td&gt;
  
                      &lt;td width="5%"&gt;&lt;?php echo $assigned; ?&gt;&lt;/td&gt;
  
                      &lt;td width="10%"&gt;&lt;span class="hours"&gt;&lt;?php echo $start_date; ?&gt;&lt;/span&gt;&lt;/td&gt;
  
                      &lt;td width="10%"&gt;
  
                      &lt;?
                      if (strtotime($row['end_date']) &lt;= strtotime(date('Y-m-d'))) {
  
                          echo ' &lt;span style="color:red;"&gt;';
                          echo $end_date;
                          echo ' &lt;span&gt;';
                      }
                      else{
                           echo $end_date;
                      }
  
                      ?&gt;
  
  
  
                    &lt;/td&gt;
  
                      &lt;td width="10%"&gt;
  
  
                      &lt;?php echo $amount; ?&gt; Est. Hrs&lt;br /&gt;
  
                      &lt;span class="hours"&gt;...............................&lt;/span&gt; &lt;br /&gt;
  
  
                      &lt;?php
                      if ( $feeA &gt;= 1 )
                      {
                          echo $feeA;
                          echo ' Mang/Coord &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeB &gt;= 1 )
                      {
                          echo $feeB;
                          echo ' Coord/Res &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeC &gt;= 1 )
                      {
                          echo $feeC;
                          echo ' Design &amp; Dev &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeD &gt;= 1 )
                      {
                          echo $feeD;
                          echo ' Art D &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeE &gt;= 1 )
                      {
                          echo $feeE;
                          echo ' Web Design &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeF &gt;= 1 )
                      {
                          echo $feeF;
                          echo ' Copy &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeG &gt;= 1 )
                      {
                          echo $feeG;
                          echo ' Photography &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeH &gt;= 1 )
                      {
                          echo $feeH;
                          echo ' Enviro Design &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeI &gt;= 1 )
                      {
                          echo $feeI;
                          echo ' Photo Manip &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeK &gt;= 1 )
                      {
                          echo $feeK;
                          echo ' Marketing &lt;br/&gt;';
                      }
  
                      ?&gt; &lt;?php
                      if ( $feeL &gt;= 1 )
                      {
                          echo $feeL;
                          echo ' Strategy Dev &lt;br/&gt;';
                      }
  
                      ?&gt;
                      &lt;?php
                      if ( $feeM &gt;= 1 )
                      {
                          echo $feeM;
                          echo ' Web Level 1 &lt;br/&gt;';
                      }
  
                      ?&gt;
  
                       &lt;?php
                      if ( $feeN &gt;= 1 )
                      {
                          echo $feeN;
                          echo ' Web Level 2 &lt;br/&gt;';
                      }
  
                      ?&gt;
  
                       &lt;span class="hours"&gt;...............................&lt;/span&gt; &lt;br /&gt;
  
                      &lt;?php
                      if ( $billing_need == 'Yes' )
                      {
                          echo '&lt;span style="color:red"&gt;';
                          echo $extended_billing;
                          echo '&lt;span&gt;';
                      }
  
                      ?&gt;
  
  
                      &lt;/td&gt;
  
  
                      &lt;td width="10%"&gt;
                      &lt;div id="changes"&gt;
  
                      &lt;div id="edit"&gt;&lt;a id="editBTN" href="edit.php?id=&lt;?php echo $id; ?&gt;" alt="Edit Project" title="Edit Project" &gt;&lt;/a&gt;&lt;/div&gt;
                      &lt;div id="trash"&gt;&lt;a id="trashBTN" href="delete.php?id=&lt;?php echo $id; ?&gt;" alt="Trash Project" title="Trash Project" &gt;&lt;/a&gt;&lt;/div&gt;
  
                      &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;&lt;?php
                                                          }
  
                                                          ?&gt;
              &lt;/tbody&gt;
  
              &lt;tfoot&gt;
                  &lt;tr&gt;
                      &lt;th width="10%"&gt;Client&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Project&lt;/th&gt;
  
                      &lt;th width="5%"&gt;Designer&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Start Date&lt;/th&gt;
  
                      &lt;th width="10%"&gt;End Date&lt;/th&gt;
  
                      &lt;th width="10%"&gt;Times&lt;/th&gt;
  
  
                      &lt;th width="10%"&gt;&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/tfoot&gt;
          &lt;/table&gt;
          &lt;?php echo $information['sum_ammount']; ?&gt;
  </code></pre>