in reply to Re^2: MySQL: placeholders and NULL values
in thread MySQL: placeholders and NULL values

I don't see any mention whether your columns can or can't be NULL. It looks to me like column b can be NULL, where column a can't. So, Mysql converts the NULL on input to the closest it can get: an empty string for VARCHAR — and it would use 0 for a number.
  • Comment on Re^3: MySQL: placeholders and NULL values

Replies are listed 'Best First'.
Re^4: MySQL: placeholders and NULL values
by jeanluca (Deacon) on May 02, 2006 at 14:52 UTC
    here is some additional info:
    mysql> desc t1 ; +-------+--------------+------+-----+------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+------------+-------+ | a | varchar(100) | YES | | TEST TABLE | | | b | int(11) | YES | | 10 | | +-------+--------------+------+-----+------------+-------+
    so they can be NULL!