title: Convert timestamp to date in MySQL query
body: <p>I want to convert a <code>timestamp</code> in MySQL to a date.</p>
  <p>I would like to format the user.registration field into the text file as a <code>yyyy-mm-dd</code>.</p>
  <p>Here is my SQL:</p>
  <pre><code>$sql = requestSQL(&quot;SELECT user.email, 
                     info.name, 
                     FROM_UNIXTIME(user.registration),
                     info.news
                     FROM user, info 
                     WHERE user.id = info.id &quot;, &quot;export members&quot;);
  </code></pre>
  <p>I also tried the date conversion with:</p>
  <pre><code>DATE_FORMAT(user.registration, '%d/%m/%Y')
  DATE(user.registration)
  </code></pre>
  <p>I echo the result before to write the text file and I get :</p>
  <blockquote>
  <p>email1;name1;DATE_FORMAT(user.registration, '%d/%m/%Y');news1</p>
  <p>email2;name2;news2</p>
  </blockquote>
  <p>How can I convert that field to date?</p>