Re: NOT NULL = Not Working?

2007-05-09 Thread Scott Baker
I knew it was an option somewhere... Perfect! Thanks JamesDR wrote: > JamesDR wrote: >> Scott Baker wrote: >>> If I create the following table, and then try and insert the following >>> data both inserts work. It looks like the second one works (it shouldn't >>> because Last is NULL) because it a

Re: NOT NULL = Not Working?

2007-05-09 Thread JamesDR
JamesDR wrote: > Scott Baker wrote: >> If I create the following table, and then try and insert the following >> data both inserts work. It looks like the second one works (it shouldn't >> because Last is NULL) because it assumes Last = ''. Is there a way I can >> make it NOT assume that? If Last i

Re: NOT NULL = Not Working?

2007-05-09 Thread Ricardo Conrado Serafim
Scott Baker escreveu: If I create the following table, and then try and insert the following data both inserts work. It looks like the second one works (it shouldn't because Last is NULL) because it assumes Last = ''. Is there a way I can make it NOT assume that? If Last is not specified it shoul

Re: NOT NULL = Not Working?

2007-05-09 Thread JamesDR
Scott Baker wrote: > If I create the following table, and then try and insert the following > data both inserts work. It looks like the second one works (it shouldn't > because Last is NULL) because it assumes Last = ''. Is there a way I can > make it NOT assume that? If Last is not specified it sh

Re: Not null not working??

2002-04-04 Thread Colin Faber
Well also, 0x00 != 0 and to test for NULL in mysql you need to use special functions IS NULL, IS NOT NULL etc. Rodney Broom wrote: > > From: Andrew Hazen <[EMAIL PROTECTED]> > > > If it was blank, the sql statement would fail... > > Nope, you're passing an empty string with '$login'. NULL is

RE: Not null not working??

2002-04-04 Thread Gurhan Ozen
Hi Andrew, If you insert NULL value into a column that is defined as NOT NULL , the server puts in empty string ('') for the value... Try to use PHP to enforce $login to have a string value. Or you can compile a source distribution with -DDONT_USE_DEFAULT_FIELDS option to overcome this. See : htt

Re: Not null not working??

2002-04-04 Thread Rodney Broom
From: Andrew Hazen <[EMAIL PROTECTED]> > If it was blank, the sql statement would fail... Nope, you're passing an empty string with '$login'. NULL is not empty, it's less that that. It's nothing. What you want is: emplogin=$login Rather than: emplogin='$login' > ...is SOMETIMES blank

RE: Not null not working??

2002-04-04 Thread Rick Emery
It is not inserting NULL. when $login is NULL or blank, then a a record, with emplogin equal to a string of zero characters is inserted, which is valid. A string with zero characters is NOT a NULL value. So, it is accepted. -Original Message- From: Andrew Hazen [mailto:[EMAIL PROTECTED