Pregunta

¿Hay una lista que describa todos los parámetros data_type que puede usar en PDOStatement :: bindParam () ? Si no hay ninguno, ¿qué utiliza habitualmente y para qué tipo de campo?

Según el manual de PHP: data_type Tipo de datos explícito para el parámetro utilizando las constantes PDO :: PARAM_ *.

Sé acerca de PDO :: PARAM_INT y PDO :: PARAM_STR . Sin embargo, he oído hablar de PDO :: PARAM_LOB pero no estaba seguro de cómo y cuándo usarlo. (¿para la fecha?)

¿Fue útil?

Solución

De la documentación aquí :

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.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top