Re: NULL Date Entries...

From: Date: Fri, 02 Jul 2010 07:19:04 +0000
Subject: Re: NULL Date Entries...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-306626@lists.php.net to get a copy of this message
Don Wieland wrote: > In one of my forms, I am building a variable that I can use as an > INSERT string. > > On my form, I have several DATE fields which exist of 3 fields MM - DD > - YYYY > > when I build my string it looks like this: > > array('dbf'=>'applicant_dob', > > 'f'=>array('applicant_dob_1','applicant_dob_2','applicant_dob_3'), > 'req'=>0, 's'=>'/'), > > This enters in the DB fine when there is a DATE, but when these fields > are left empty, it inserts into the the DB as 2069-12-31. > > How does one deal with this? > > Don Wieland Aside from all the good advice already offered, if you want to accept a null date, check what your DB does with it and whether you can set a default for an empty date. Mysql for example can use 0000-00-00 Cheers -- David Robley Microsoft - We put the "backwards" into backwards compatibility. Today is Pungenday, the 37th day of Confusion in the YOLD 3176.

« previous php.general (#306626) next »