2008-11-25 36 views
9

是否有列表描述您可以在PDOStatement::bindParam()中使用的所有data_type參數?如果沒有,你通常使用什麼,以及什麼類型的領域?PDostatement :: bindParam data_type參數列表

根據PHP手冊:data_type使用PDO :: PARAM_ *常量的參數的顯式數據類型。

我知道PDO::PARAM_INTPDO::PARAM_STR。我聽說過PDO::PARAM_LOB,但我不確定如何以及何時使用它。 (日期?)

回答

17

從文檔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. 
+1

是的,是我不好,我錯過了節還有。應該搜索PDO常量而不是PDO語句bindParam()。非常感謝tomhaigh。 – andyk 2008-11-25 10:44:18

相關問題