title: Output mysql query result in a php variable
body: <p>I have this variable (<code>$sql</code>) in PHP:</p>
  
  <pre><code>$sql = "SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(CURRENT_DATE, dob)),'%y Years %m Months %d Days') AS age WHERE id=$row[id]";
  </code></pre>
  
  <p>How to output the produced data as a <em>PHP variable</em>?</p>
  
  <p>The query is taking the date of birth from my table and calculating the age from today's date.</p>
  
  <p>How to echo the age in PHP? </p>