This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL, SQLite and MS SQL Server; also available for Wordpress.

Welcome! Log In Create A New Profile


Date like 1997-00-00

Posted by mauri 
Date like 1997-00-00
March 12, 2011 08:53PM

I noticed that if I store dates with 00 in day or month, using mysql directly, then the DaDaBIK update screens for such field show those values as "01".

Upon update, the values will be changed in database too.

As you probably are aware, MySQL can be set to accept these invalid zero values, possibly useful for example to indicate that the exact day was not known.

This is not a big issue, but perhaps you should note this somewhere so when you next time touch the date field code, you might take this into account.

I haven't checked how the behaviour of the database could be queried - there is probably a way to fish these configuration values out of MySQL.

DaDaBIK 4.3
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu
PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch

Best regards,

Mauri Tikka
Re: Date like 1997-00-00
April 21, 2011 10:30AM
Thanks for having reported this. I didn't know about this mysql feature (that actually I would consider a bug smiling smiley ).

Eugenio |\.-./| DaDaBIK founder
Re: Date like 1997-00-00
April 27, 2011 03:52PM

yeah - I also think it is a bad habit to use "special values" to represent special cases in variables like here in MySQL. It will always cause trouble, sooner or later. The "proper" way would instead use separate (off channel) bits to indicate whether the values of the date field are valid or not.

Sorry, only registered users may post in this forum.

Click here to login