Is there any way that PHP can know whether a column in a MySQL table is a BOOL or an INT?

    in mySQL, there really is no boolean field type. BIT, BOOL and BOOLEAN are simply synonyms for TINYINT(1). A value of zero is considered false. Non-zero values are considered true.

      Yes, I am aware that BOOL is just a shortcut for a TINYINT and it is just plain old INT.

      Is there a way to, then, to check the min/max possible values of a column?

      ie.: TINYINT only stores -128 to +127; whereas INT stores -2147483648 to +2147483647. If I could find this out, I could then check if a column is a TINYINT or an INT.

        Uh, yeah - but that would create a lot of complicated and taxing string processing with PHP. Is there not some sort of built in PHP MySQL function that can do this?

          Agh! Never mind, I get it now. DESCRIBE returns results the same way that a normal table does. Duh 😃

            Write a Reply...