[thelist] MySQL data typesL

Brent Rieck bsr at spek.org
Wed Jan 16 18:36:06 CST 2002


On Wed, 2002-01-16 at 16:03, noah wrote:
> This all checks out. When I add a record, though, and specify "" for this 
> column (from PHP), MySQL puts a 0 in there.

I believe that's where your problem is: "" is a zero length string
(which MySQL will interpret as the numerical value 0), and NULL is,
well, null - and they're *not* equivalent.  When inserting nulls specify
the value as NULL with no quotes.  (in the "test" table from my previous
email it would look like: "insert into test values (NULL);")

--Brent




More information about the thelist mailing list