The default of the 3 parameter that is optional is PDO::PARAM_STR
in case of your question, you do not have to pass because email is already given%
Code syntax:
string
It is only necessary to pass the 3 parameter, when the data type is to be informed as for example an integer data, a Boolean data, etc. and influence on information recording, an example is to record a photo ( public bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] )
) in your table as shown below:
$foto = file_get_contents($foto['tmp_name']);
$stmt->bindParam(':foto', $foto, PDO::PARAM_LOB);
Existing types are:
-
array de bytes
-
PDO::PARAM_BOOL
-
PDO::PARAM_NULL
-
PDO::PARAM_INT
-
PDO::PARAM_STR
-
PDO::PARAM_LOB
-
PDO::PARAM_STMT
It's worth remembering that some data types do not have a predefined constant, for example, date , date and time , monetary value , etc. , these data types are passed as text and the conversion is transparent , just the layout that the database recognizes, a date and time example is PDO::PARAM_INPUT_OUTPUT
.
References: