Menu
  • HOME
  • TAGS

Tinyint in MySQL Results Returning Wrong Values

php,mysql,pdo,tinyint

The most logical explanation for the behavior you observe... the activated column contains a value of 1. To see if you have anything other than a 1 stored, you could run a query like this: SELECT c.activated, COUNT(*) AS cnt FROM customers GROUP BY c.activated To find individual rows that...

MySQL TINYINT(1) versus BIT(1)

mysql,bit,tinyint

A TINYINT will always have a size of one (1) byte. And accept values between -128 and 127 (if signed). The number you put in the brackets is for display purposes. A BIT(1) on the other hand only take one bit in storage but needs to be aligned to whole...