Список параметров PDOStatement :: bindParam data_type - PullRequest
9 голосов
/ 25 ноября 2008

Есть ли список, описывающий все параметры типа data_type, которые вы можете использовать в PDOStatement::bindParam()? Если нет, что вы обычно используете и для какого типа поля?

Согласно руководству по PHP: data_type Явный тип данных для параметра с использованием констант PDO :: PARAM_ *.

Я знаю о PDO::PARAM_INT и PDO::PARAM_STR. Я слышал о PDO::PARAM_LOB, но я не знал, как и когда это использовать. (на свидание?)

1 Ответ

17 голосов
/ 25 ноября 2008

Из документации здесь :

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.
...