Welcome Guest, Not a member yet? Register   Sign In
My date when leave blank still save this format in my db:1970-01-01
#6

[eluser]jmadsen[/eluser]
what do you mean, "pressure on your db"?

you have four elements in your array, this one for example:

'photos_date' => date('Y-m-d',strtotime($this->input->post('photos_date')))

take it out of the array you have now, and only add it conditionally. something like:

Code:
if ($this->input->post('photos_date')){
     $project_info['photos_date'] = date('Y-m-d',strtotime($this->input->post('photos_date')));
}

Put that AFTER your current array setup. if $project_info['photos_date'] isn't there, it won't get passed in the INSERT statement, and the default will be used


Messages In This Thread
My date when leave blank still save this format in my db:1970-01-01 - by El Forum - 06-20-2011, 09:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB