I have some columns that may contain data that is if the user wants to provide it.
Example | Email | First Name | Last Name |
Email - Required so column is set to NOT NULL - Default: None
First Name - Not Required so column set to NULL - Default: NULL
Last Name - Not Required so column set to NULL - Default: NULL
In phpmyadmin when creating/editing a column; it has an option saying Default: with a drop down showing None | As Defined | NULL | Current Timestamp
Because First Name | Last Name is optional and not required should I choose default NULL or maybe NONE?
Which is best and why please?
I know there are many discussions on this already but I could not find any that answered my question; they was more in regards to allowing NULL or NOT NULL, my question is about default value.
You should set them to Default:Null as if the user doesn't provide any info for that fields, they should be null obviously.
Use NULL, None mode is inserting 'None' or some '' string to indicate that there is nothing there....
For more information why you want to use NULL versus a string look here: MySQL, better to insert NULL or empty string?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With