0

I am a data grid implemented in the Impresspages admin environment. The form has date fields. The problem is the following. Entered date is storage in Mysql (and logically returned too) like 000-00-00. I caught the public function createData($postData) from one field in the grid and the content is correct, the fields value are right. Let's see:

array(12) { 
   ["securityToken"]=> string(32) "b9d273d7f6f17a43eacb61a008543d21"
   ["antispam"]=> array(2) { [0]=> string(0) "" [1]=> string(32) 
   "692a03a931157644de8a0986ebfa54ea" } 
   ["active"]=> string(1) "1" 
   ["starSign"]=> string(2) "22" 
   ["startPeriod"]=> string(10) "2015-04-25" 
   ["endPeriod"]=> string(10) "2015-04-25" 
   ["prevLove"]=> string(25) "dsdsds" 
   ["prevHealth"]=> string(25) "asasas" 
   ["prevBiz"]=> string(27) "lklklklk" 
   ["prevLucky"]=> string(27) "fgfgfgfg" 
   ["languageId"]=> string(1) "2" 
   ["createdAt"]=> string(19) "2015-04-22 14:02:37" 
 }

Look at the fields startPeriod and EndPeriod. In the data array they are set up to real values typed: 2015-04-22, However it is stored in the DB the weird value 0000-00-00. Any idea, please? Thanks.

chiwangc
  • 3,566
  • 16
  • 26
  • 32

1 Answers1

0

Check the camelCase issue. Maybe in your database those fields are not in the same upper/lower case. This is the issue if you migrate your database between windows/unix. Make user that your config is exactly the same and you don't have any mistype.

you get 0000-00-00 on MySQL field when you provide incorrect value or you don't provide any value and the field is set as NOT NULL.

I personally never got such issue with Date field.