Home >Backend Development >PHP Tutorial >MySql implicit column description changes_PHP tutorial
In some cases, MySQL implicitly changes a column description given in a CREATE TABLE statement. (This is also possible in ALTER TABLE.) VARCHARs with length less than 4 are changed to CHAR. If any column in a table has variable length, the result is that the entire row is variable length. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than 3 characters are changed to VARCHAR columns. This does not affect how you use the column in any way; in MySQL, VARCHAR is just a different way of storing characters.
MySQL implements this change because it saves space and makes table operations faster. Select a table type. The display size of TIMESTAMP must be an even number and within the range of 2 to 14. If you specify a display size of 0 or larger than 14, the size is forced to 14. Odd numeric sizes in the range 1 to 13 are forced to the next larger even number. You cannot store a literal NULL in a TIMESTAMP column; setting it to NULL will set it to the current date and time. Because TIMESTAMP columns behave like this, the NULL and NOT NULL attributes are not used in the usual way and will be ignored if you specify them. DESCRIBE tbl_name always reports that the TIMESTAMP column may be assigned a NULL value. MySQL maps a certain column type used by other SQL database vendors to a MySQL type. If you want to know whether MySQL is using a column type other than the one you specified, issue a DESCRIBE tbl_name statement after creating or altering your table. If you use myisampack to compress a table, some other column types may change.