For the character data fields, if the values is empty, I can input the '' string or set up the default values as ''. So when I grab the values from the database and display it on the web page, that field will be just empty string there as I want.
But for the data fields that is numeric or date type, I cannot use the '' as the default values.
For the date_applied (datetime type), the default value could not be set up to '', so if I don't set it up to default as NULL, it will be default to 0000-00-00 00:00:00.
And when I grab the value to display in the web page, it would be displayed as 0000-00-00 00:00:00. Very Ugly.
So I should set the default value for datetime type as NULL if it is not a required fields and allows NULL.
This applies to the price these kind numeric field etc.
If I have a car or house to list on the web, but the price is not listed at this moment. I would not want to see the price default value to be 0, I want to see an empty field there. Since I cannot set up the numeric data field to be default as '', so I will have to set them to be default as NULL.
Here comes the questions,
When I use the MySQL CC, I cannot set up the default values to be NULL for these numeric data type or date data type fields. Is it a bug of MySQL CC?
In what case you would prefer to set up the default value as NULL, in what case you would set the default as ''?
For example, for the no value case in the text fields, I would prefer to use empty string to represent no value. Because, when I gather this information through web form fields, I can simply input the values from the form fields (which is empty string), I don't have to detect first if the form fields have the values or not, if they have values then input as it is, but if they are empty, i will have to change my mysql statements to set it as NULL instead of simply input the form fields values which is empty string.