title: PHP/MySQLi: SET lc_time_names and DATE_FORMAT() into a mysqli query?
body: <p>I use the next code to retrieve data from a table in the database:</p>
  
  <pre><code>$check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
      if ($stmt-&gt;prepare($check_sql)) {
          $stmt-&gt;bind_param('i', $pid);
          $stmt-&gt;bind_result($personDB, $name, $birthdate, $birthplace, $countryID);
          $stmt-&gt;execute();
          $stmt-&gt;fetch();
      }
  </code></pre>
  
  <p>Like you can see, at the same time I format the date from the 'birthdate' column to a more friendly display using the DATE_FORMAT() MySQL function. Now, I want to display the month full names in Spanish, so I want to insert <code>SET lc_time_names = 'es_ES'</code> into the query..</p>
  
  <p>How can I do it??? Can I add <code>SET lc_time_names</code> to the $check_sql variable??</p>
  
  <p>Thanks!!</p>