title: get all dates between multiple date range from mysql table
body: <p>This is <strong>My MySQL table:</strong></p>
  
  <pre><code>Name      From          To           LeaveType
  --------------------------------------------------
  Ravi    2015-01-01    201-01-02      Casual Leave
  Sudha   2015-01-02    201-01-02      Sick Leave
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>2015-01-01
  -----------
  1. ravi  CL
  
  2015-01-02
  -------------
  1. ravi    CL
  2. Sudha   SL
  </code></pre>
  
  <p>This is my <strong>Mysql Query:</strong></p>
  
  <pre><code>SELECT 
        leave_id,
        emp_id,
        Employee_id,
        name,
        `from`,
        `to` 
  FROM emp_leave    
  WHERE hod_id='42' AND
        from` BETWEEN '2015-4-01' AND '2015-04-10' AND 
       `to` BETWEEN '2015-4-01' AND '2015-04-10' 
  ORDER BY `from`
  </code></pre>