Jump to content


Photo

int(11) NOT NULL default '',


  • Please log in to reply
3 replies to this topic

#1 deRusett

deRusett
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 03 December 2003 - 06:33 AM

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

#2 deRusett

deRusett
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 04 December 2003 - 11:06 PM

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!

#3 triphis

triphis
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 05 December 2003 - 02:27 AM

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 =/
Xac Attack

#4 deRusett

deRusett
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 05 December 2003 - 05:50 AM

NULL does not equal zero, NULL is more can be igored, or Ignore this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users