Setting an empty default value for a char-column in MySQL?

Posted by user281434 on Stack Overflow See other posts from Stack Overflow or by user281434
Published on 2010-03-20T11:58:23Z Indexed on 2010/03/20 12:01 UTC
Read the original article Hit count: 148

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about php