title: Displaying Links in order of opening and closing dates
body: <p>I have four links stored in MySQL, with opening &amp; closing dates.</p>
  
  <p>I want to display them by Ascending order of closing dates. But while arranging them they should also be arranged in Ascending order of opening dates.</p>
  
  <p>For Eg:</p>
  
  <p>Link A (Opening: 21/10/17 &amp; Closing 23/10/17)</p>
  
  <p>Link B (Opening: 21/10/17 &amp; Closing 22/10/17)</p>
  
  <p>Link C (Opening: 20/10/17 &amp; Closing 23/10/17)</p>
  
  <p>Link D (Opening: 20/10/17 &amp; Closing 22/10/17)</p>
  
  <p>So the links should be displayed as:</p>
  
  <ul>
  <li>Link D</li>
  <li>Link B</li>
  <li>Link C</li>
  <li>Link A</li>
  </ul>
  
  <p><code>Opening Date = Odate &amp; Closing Date = Cdate</code></p>
  
  <p>I tried:</p>
  
  <p><code>$stmt = $user_home-&gt;runQuery('SELECT * FROM links ORDER BY Cdate ASC ');</code> 
  but it only arranges in ascending order as per closing dates.</p>
  
  <p>My Table Structure <a href="https://i.stack.imgur.com/WQjwN.png" rel="nofollow noreferrer">see here</a></p>