0

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 Answer 1

2

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?

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.