views:

24

answers:

1

Hi

In phpMyAdmin I have a char(32) column that has no default value(ie. Default: None). When I try to insert data through a SQL query, it throws out an error saying that the column "doesn't have a default value". I need it to be empty, so instead I've just set it's default value as "As defined: " and then nothing in the value field. Is this a bad idea?

And is it any better than simply throwing in an empty value for the column in the SQL query?

Thanks for your time.

+1  A: 

You are trying to insert a row that does not have some columns defined. These columns may either be NULL or a defined default value. It is up to you to decide what action to take when no data is provided for a column - do you want it to be NULL (i.e. empty) or a defined value?

PP
I've heard that NULL takes up more space than an empty value, is that true?
soren.qvist