Question

Existe-t-il une liste décrivant tous les paramètres de type données que vous pouvez utiliser dans PDOStatement :: bindParam () ? Si vous n'en avez aucune, qu'utilisez-vous couramment et pour quel type de champ?

Selon le manuel PHP: type_données Type de données explicite pour le paramètre utilisant les constantes PDO :: PARAM_ *.

Je connais les codes PDO :: PARAM_INT et PDO :: PARAM_STR . J'ai entendu parler de PDO :: PARAM_LOB mais je ne savais pas comment et quand l'utiliser, cependant. (pour date?)

Était-ce utile?

La solution

Dans la documentation ici :

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.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top