代码之家  ›  专栏  ›  技术社区  ›  andyk

pDestatement::BindParam数据类型参数列表

  •  9
  • andyk  · 技术社区  · 16 年前

    是否有描述所有数据类型参数的列表 PDOStatement::bindParam() ?如果没有,您通常使用什么,对于什么类型的字段?

    根据PHP手册: 数据类型 使用pdo::param_x常量的参数的显式数据类型。

    我知道 PDO::PARAM_INT PDO::PARAM_STR . 我听说过 PDO::PARAM_LOB 但我不知道如何以及何时使用它。(日期)?

    1 回复  |  直到 15 年前
        1
  •  17
  •   Tom Haigh    16 年前

    从文档中 here :

    PDO::PARAM_BOOL (integer)
    Represents a boolean data type.
    PDO::PARAM_NULL (integer)
    Represents the SQL NULL data type.
    PDO::PARAM_INT (integer)
    Represents the SQL INTEGER data type.
    PDO::PARAM_STR (integer)
    Represents the SQL CHAR, VARCHAR, or other string data type.
    PDO::PARAM_LOB (integer)
    Represents the SQL large object data type.
    PDO::PARAM_STMT (integer)
    Represents a recordset type. Not currently supported by any drivers.
    PDO::PARAM_INPUT_OUTPUT (integer)
    Specifies that the parameter is an INOUT parameter for a stored procedure. You must bitwise-OR this value with an explicit PDO::PARAM_* data type.