The default of the 3 parameter that is optional is PDO::PARAM_STR
in the case of your question, it is not necessary to pass, because, email is already a given string
(text) .
Code syntax:
public bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] )
It is only necessary to pass the 3 parameter, when the data type should be informed as for example an integer data, a boleano data, etc. and influence on the recording of information, an example is to save a photo (array de bytes
) in your table as shown just below:
$foto = file_get_contents($foto['tmp_name']);
$stmt->bindParam(':foto', $foto, PDO::PARAM_LOB);
Existing types are:
PDO::PARAM_BOOL
PDO::PARAM_NULL
PDO::PARAM_INT
PDO::PARAM_STR
PDO::PARAM_LOB
PDO::PARAM_STMT
PDO::PARAM_INPUT_OUTPUT
Remember that some types of data do not exist predefined constant, for example, date, date and time, monetary value, etc, these types of data are passed as text and the conversion is transparent, only need to be informed the layout that the bank recognizes, an example date and time is yyyy-mm-dd hh:mm:ss
.
References:
Related: http://answall.com/questions/188745
– Woss
Related: http://answall.com/questions/51712
– Woss