I was now doing a statement with on duplicate and I have some fields like BIT
. My DB class does typing using PDO::PARAM_STR
, PDO::PARAM_BOOL
, PDO::PARAM_INT
... but the use of these constants is optional, and when not entered it follows the PDO
p>
SQLSTATE [22001]: String data, right truncated: 1406 Data too long for column 'FIELD' at row 1 'in [...]
I omitted the constants at run time, so it was with the default value, but I received the above error message. The passed value was an integer 1
- not a string '1'
.
I want to understand the difference between 1
type int and 1
type str . How does MYSQL get the same number and knows that one is a string and another is an integer?