Default values for varchar and int mysql data types Default values for varchar and int mysql data types php php

Default values for varchar and int mysql data types


Default none means there is no default value. If a value is not provided on an insert, the query will fail with a "no default value error".

NULL is the actual NULL value meaning if no value is provided on an insert the column will default to NULL (empty). For varchar you can set default to '', but NULL is better.

Autoincrement int types shouldn't have a default value (Default: None) because it will always have a value.