title: my code works fine with two selects but Im trying to use just one
body: <p>I have a table "shedules" where I keep always two records(my shedules are saved in pdf format).</p>
  
  <p>One record is relative to 1st year shedule, so my record is like:</p>
  
  <p><strong>(id,pdf,year)</strong> <strong>(1,../uploads/shedules/1st_year.pdf, 1st_year)</strong></p>
  
  <p>My othe record is like:</p>
  
  <p><strong>(id,pdf,year)</strong> <strong>(2,../uploads/shedules/2nd_year.pdf, 2nd_year)</strong></p>
  
  <p>My shedules are updated every week, but can be updated without a specific order, can first be updated schedule of the first year or second year.</p>
  
  <p>And in my form, where I update my schedules, I also have two links to show 
  current schedules of each year.</p>
  
  <p>And I want to show on my link "See schedule 1st year" my schedule pdf of my 1st year, and I want to show on my link "See schedule 2nd year" my schedule pdf of my 2nd year.</p>
  
  <p>Do you know how can I do that without doing two selects?? I already did with two selects but now Im trying to do only using one.</p>
  
  <p>I was trying using "order by year asc" but dont works fine because the user that update shedules can insert first my 1st year or 2nd year...</p>
  
  <pre><code>&lt;?php
      $readShedules = $pdo-&gt;prepare("SELECT pdf from schedules ORDER BY year ASC");
      $readShedules-&gt;execute();
      $result = $readShedules-&gt;fetch(PDO::FETCH_ASSOC);     
      echo '&lt;div&gt;';
       echo '&lt;a style="margin-right:10px;" href="../uploads/pdfs/'.$result['pdf'].'"&gt;See schedules 1st year&lt;/a&gt;';
       echo '&lt;a href="../uploads/pdfs/'.$result['pdf'].'"&gt;See schedule 2nd year&lt;/a&gt;';
      echo '&lt;/div&gt;&lt;!--viewcapa--&gt;';  
  ?&gt; 
  </code></pre>