title: return results from a query in php
body: <p>I have got this results of a query:
  (book_id, yr)   </p>
  
  <pre><code>37 2014 
  37 2012
  35 2013
  35 2012
  35 2011
  </code></pre>
  
  <p>I would like to echo it like this</p>
  
  <pre><code>book id is 37 from 2014
  editions available are 2014 and 2012 
  </code></pre>