S
S
SimBioT192015-09-30 13:30:46
PHP
SimBioT19, 2015-09-30 13:30:46

PDO, is it mandatory to use constants?

Is it necessary to specify PDO::PARAM_INT (PDO::PARAM_STR, etc.) as well, or does it make no sense without the bindParam constant? $query -> bindParam(':id', $id);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shagguboy, 2015-09-30
@shagguboy

no.
public bool PDOStatement::bindParam ( mixed $parameter , mixed &$variable [, int $data_type = PDO::PARAM_STR
is a string by default, MYSQL works with them correctly. problems can be with complex types and/or locales. like format default date, decimal separator, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question