title: Selecting records older than 15 days ago
body: <p>How can i display only records older then 15 days ago by the column <code>updatetime</code> ?</p>
  
  <p>Code </p>
  
  <pre><code>    $conn = mysql_connect($servername,$database_username,$database_password);
      $sql = 'SELECT * FROM user_shift_test2';
      $result = mysql_query( $sql, $conn );
      if(! $result )
      {
        die('Could not get data: ' . mysql_error());
      }
      $i=1;
  </code></pre>
  
  <p>While loop which is fetching all the rows</p>
  
  <pre><code>    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
      {
        echo '&lt;tr&gt;';
          $res = $row['userid'];
          echo "&lt;td&gt;&lt;input type='checkbox' name='chk[]' value='$res'&gt;&lt;/td&gt;";
  
         echo 
          "&lt;td&gt;{$row['userid']}  &lt;br&gt; &lt;/td&gt;".
         "&lt;td&gt;{$row['id']}  &lt;br&gt; &lt;/td&gt;".
                "&lt;td&gt;{$row['name']}  &lt;br&gt; &lt;/td&gt;".
                "&lt;td&gt;{$row['shifttime']}  &lt;br&gt; &lt;/td&gt;".
                "&lt;td&gt;{$row['dayoff']}  &lt;br&gt; &lt;/td&gt;".
                "&lt;td&gt;{$row['updatetime']}  &lt;br&gt; &lt;/td&gt;&lt;/tr&gt;";
                } 
      ?&gt;
  </code></pre>