• <bdo id='ST3GP'></bdo><ul id='ST3GP'></ul>
  • <legend id='ST3GP'><style id='ST3GP'><dir id='ST3GP'><q id='ST3GP'></q></dir></style></legend>
    1. <tfoot id='ST3GP'></tfoot>

      <small id='ST3GP'></small><noframes id='ST3GP'>

      <i id='ST3GP'><tr id='ST3GP'><dt id='ST3GP'><q id='ST3GP'><span id='ST3GP'><b id='ST3GP'><form id='ST3GP'><ins id='ST3GP'></ins><ul id='ST3GP'></ul><sub id='ST3GP'></sub></form><legend id='ST3GP'></legend><bdo id='ST3GP'><pre id='ST3GP'><center id='ST3GP'></center></pre></bdo></b><th id='ST3GP'></th></span></q></dt></tr></i><div id='ST3GP'><tfoot id='ST3GP'></tfoot><dl id='ST3GP'><fieldset id='ST3GP'></fieldset></dl></div>

        PHP/MySQLi:将 lc_time_names 和 DATE_FORMAT() 设置为 mysq

        时间:2023-07-28
          <bdo id='YL6AV'></bdo><ul id='YL6AV'></ul>
          <legend id='YL6AV'><style id='YL6AV'><dir id='YL6AV'><q id='YL6AV'></q></dir></style></legend>
          1. <small id='YL6AV'></small><noframes id='YL6AV'>

                <tbody id='YL6AV'></tbody>
            • <tfoot id='YL6AV'></tfoot>

                • <i id='YL6AV'><tr id='YL6AV'><dt id='YL6AV'><q id='YL6AV'><span id='YL6AV'><b id='YL6AV'><form id='YL6AV'><ins id='YL6AV'></ins><ul id='YL6AV'></ul><sub id='YL6AV'></sub></form><legend id='YL6AV'></legend><bdo id='YL6AV'><pre id='YL6AV'><center id='YL6AV'></center></pre></bdo></b><th id='YL6AV'></th></span></q></dt></tr></i><div id='YL6AV'><tfoot id='YL6AV'></tfoot><dl id='YL6AV'><fieldset id='YL6AV'></fieldset></dl></div>
                  本文介绍了PHP/MySQLi:将 lc_time_names 和 DATE_FORMAT() 设置为 mysqli 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用下一个代码从数据库中的表中检索数据:

                  I use the next code to retrieve data from a table in the database:

                  $check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
                      if ($stmt->prepare($check_sql)) {
                          $stmt->bind_param('i', $pid);
                          $stmt->bind_result($personDB, $name, $birthdate, $birthplace, $countryID);
                          $stmt->execute();
                          $stmt->fetch();
                      }
                  

                  如您所见,同时我使用 DATE_FORMAT() MySQL 函数将生日"列中的日期格式化为更友好的显示.现在,我想用西班牙语显示月份的全名,所以我想在查询中插入 SET lc_time_names = 'es_ES' ..

                  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 SET lc_time_names = 'es_ES' into the query..

                  我该怎么做???我可以将 SET lc_time_names 添加到 $check_sql 变量中吗?

                  How can I do it??? Can I add SET lc_time_names to the $check_sql variable??

                  谢谢!!

                  推荐答案

                  $mysqli = new mysqli("localhost", "my_user", "my_password", "world");
                  $mysqli->query("SET lc_time_names = 'es_ES'");
                  $check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
                          if ($stmt = $mysqli->prepare($check_sql)) {
                                  $stmt->bind_param('i', $pid);
                                  $stmt->bind_result($personDB, $name, $birthdate, $birthplace, $countryID);
                                  $stmt->execute();
                                  $stmt->fetch();
                          }
                  

                  这篇关于PHP/MySQLi:将 lc_time_names 和 DATE_FORMAT() 设置为 mysqli 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:警告 :: 无效的对象或资源 mysqli_stmt.含义和解决方 下一篇:如何检查 UPDATE mysqli 查询是否正确执行?

                  相关文章

                  最新文章

                • <small id='iKjRm'></small><noframes id='iKjRm'>

                  1. <tfoot id='iKjRm'></tfoot>

                      <legend id='iKjRm'><style id='iKjRm'><dir id='iKjRm'><q id='iKjRm'></q></dir></style></legend>
                        <bdo id='iKjRm'></bdo><ul id='iKjRm'></ul>
                      <i id='iKjRm'><tr id='iKjRm'><dt id='iKjRm'><q id='iKjRm'><span id='iKjRm'><b id='iKjRm'><form id='iKjRm'><ins id='iKjRm'></ins><ul id='iKjRm'></ul><sub id='iKjRm'></sub></form><legend id='iKjRm'></legend><bdo id='iKjRm'><pre id='iKjRm'><center id='iKjRm'></center></pre></bdo></b><th id='iKjRm'></th></span></q></dt></tr></i><div id='iKjRm'><tfoot id='iKjRm'></tfoot><dl id='iKjRm'><fieldset id='iKjRm'></fieldset></dl></div>