PDO with type BIT

3

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?

    
asked by anonymous 18.08.2015 / 04:10

1 answer

1

If you can do the query in mysql, just pass the querys to a table.

something of the genre

/ * will give you a field that is null in the table  SELECT ISNULL (CAST (TEMP AS BIT), 0) AS STATE

then no where you compare with not null or null

    
18.08.2015 / 11:59