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

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

      2. PDO::PARAM 日期?

        时间:2023-10-05
          <bdo id='Icm3M'></bdo><ul id='Icm3M'></ul>

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

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

                • <legend id='Icm3M'><style id='Icm3M'><dir id='Icm3M'><q id='Icm3M'></q></dir></style></legend>

                    <tbody id='Icm3M'></tbody>
                • 本文介绍了PDO::PARAM 日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  是否存在一些可用于日期或时间戳的 PDO::PARAM_????

                  Does some PDO::PARAM_??? exist which can be used for dates or timestamps?

                  示例代码:

                  $sql = "UPDATE my_table SET current_date = :date WHERE id = 43";
                  $statement = $pdo->prepare ($sql);
                  $statement->bindValue (":date", strtotime (date ("Y-m-d H:i:s")), PDO::PARAM_STR);
                  $statement->execute ();
                  

                  推荐答案

                  在 SQL 查询中写入日期时,您将其写入为字符串;您必须对准备好的语句执行相同的操作,并使用 PDO::PARAM_STR,就像您在建议的代码部分中所做的那样.

                  When writing a date in an SQL query, you are writing it as a string; you have to do the same with prepared statements, and use PDO::PARAM_STR, like you did in the portion of code you proposed.

                  对于时间戳",如果您指的是时间戳":

                  And for the "timestamp", if by "timestamp" you mean:

                  • MySQL 时间戳数据类型:相同,您将其作为 string
                  • 传递
                  • PHP Unix 时间戳,它是一个整数:您将传递给它一个 int.

                  这篇关于PDO::PARAM 日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:完全理解 PDO ATTR_PERSISTENT 下一篇:大结果集的 PDO/MySQL 内存消耗

                  相关文章

                  最新文章

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

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

                  • <bdo id='ZxBEL'></bdo><ul id='ZxBEL'></ul>

                      <legend id='ZxBEL'><style id='ZxBEL'><dir id='ZxBEL'><q id='ZxBEL'></q></dir></style></legend>