title: how to find out missing date in mysql using php
body: <p>How to find out missing date in MySQL using PHP?</p>
  
  <pre><code>echo "&lt;tr&gt; &lt;th&gt;Username&lt;/th&gt;&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Check In&lt;/th&gt;&lt;th&gt;Check Out&lt;/th&gt; &lt;/tr&gt;";
  
  // get results1 from database 
  $result1 = mysql_query("SELECT * FROM attend WHERE user_name='ali' AND date BETWEEN '2015-07-01' AND '2015-07-15' order by date");
  
  while($row = mysql_fetch_array($result1))
  {   
      // echo out the contents of each row into a table
      echo "&lt;tr&gt;";
      echo '&lt;td&gt;' . $row['user_name'] . '&lt;/td&gt;';
      echo '&lt;td&gt;' . $row['date'] . '&lt;/td&gt;';
      echo '&lt;td&gt;' . $row['checkin'] . '&lt;/td&gt;';
      echo '&lt;td&gt;' . $row['checkout'] . '&lt;/td&gt;';
      echo "&lt;/tr&gt;";    
  }
  echo "&lt;/table&gt;";
  </code></pre>
  
  <p>currently result</p>
  
  <pre><code>Username    Date    Check In    Check Out
  ali     2015-07-01  11:30:34    17:23:47
  ali     2015-07-02  10:11:34    17:15:15
  ali     2015-07-03  09:32:34    18:16:27
  ali     2015-07-06  10:41:34    16:56:13
  ali     2015-07-07  08:51:34    17:36:01
  ali     2015-07-08  05:61:34    17:16:26
  ali     2015-07-09  04:11:34    17:14:12
  ali     2015-07-10  02:81:34    17:25:25
  ali     2015-07-13  11:71:34    17:02:29
  ali     2015-07-14  10:81:34    17:04:20
  ali     2015-07-15  09:31:34    17:00:43
  </code></pre>
  
  <p>and i want result like this</p>
  
  <pre><code>Username    Date    Check In    Check Out
  ali     2015-07-01  11:30:34    17:23:47
  ali     2015-07-02  10:11:34    17:15:15
  ali     2015-07-03  09:32:34    18:16:27
          2015-07-04
          2015-07-05
  ali     2015-07-06  10:41:34    16:56:13
  ali     2015-07-07  08:51:34    17:36:01
  ali     2015-07-08  05:61:34    17:16:26
  ali     2015-07-09  04:11:34    17:14:12
  ali     2015-07-10  02:81:34    17:25:25
          2015-07-11
          2015-07-12
  Ali     2015-07-13  11:71:34    17:02:29
  ali     2015-07-14  10:81:34    17:04:20
  ali     2015-07-15  09:31:34    17:00:43
  </code></pre>