The top of the picture is the data to be inserted, and below is Getlastsql () gets the INSERT statement Dateline field value changed?
Reply content:
The top of the picture is the data to be inserted, and below is Getlastsql () gets the INSERT statement Dateline field value changed?
If you look at the dataline format in the database, TP will check the format of the field in the database and convert the data to the corresponding format when inserting the data.
if(!isset($this->options['bind'][':'.$key]) && isset($this->fields['_type'][$key])){ $fieldType = strtolower($this->fields['_type'][$key]); if(false !== strpos($fieldType,'enum')){ // 支持ENUM类型优先检测 }elseif(false === strpos($fieldType,'bigint') && false !== strpos($fieldType,'int')) { $data[$key] = intval($data[$key]); }elseif(false !== strpos($fieldType,'float') || false !== strpos($fieldType,'double')){ $data[$key] = floatval($data[$key]); }elseif(false !== strpos($fieldType,'bool')){ $data[$key] = (bool)$data[$key]; } }
And the length of the database field definition.
First, the Data Inventory time field is recommended as an int (10) type
High space efficiency and very flexible
The time conversion format can be converted in PHP.
The framework will format the data, since the framework is not appropriate that the native is good, to understand why it is necessary to see the framework of the source