Jump to content

Archived

This topic is now archived and is closed to further replies.

deRusett

int(11) NOT NULL default '',

Recommended Posts

I was just building a DB for a project I am doing

 

when it occered to me, I have never done

`something` int(11) NOT NULL default \'\',

always

`something` int(11) NOT NULL default \'0\',

 

what does mySQL do if I do

 

`something` int(11) NOT NULL default \'\',

 

 

the reason I ask is some of the formula I will be using, will talk to the something cell, will not work correctly if there is a 0 in that cell, BUT the default can not be a 1, I need it to ignore the cell if there is nothing in it.

 

I\'m about 3 or 4 tables away from even droping this file into mySQL to make DB\'s and figured it wouldn\'t hurt to throw this question out to the world and see what comes back

Share this post


Link to post
Share on other sites

Well it would seem that

 

`something` int(11) NOT NULL default \'\',

 

is not permitted, and one must use

 

`something` int(11) NOT NULL default \'0\',

 

everyone I have asked seems to think I will generate an error if I leave it as

 

 

`something` int(11) NOT NULL default \'\',

 

crappy!

Share this post


Link to post
Share on other sites

I haven\'t really worked with NOT NULL/NULL for mysql tables but doesn\'t NULL = 0? If you specified NOT NULL, then it makes sence that \'0\' wouldn\'t work as a value =/

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.