i can\'t insert the values from my JQuery Datepicker to my MySQL database with Date datatype. how will i convert string to date datatype? im using Codeigniter with MVC. here\'s
Your controller should look like this:
{ $date = $this->input->post('dob'); $data = array( 'FirstName' => $this->input->post('fname'), 'DateofBirth' => date('Y-m-d', strtotime($date)) ); $this->site_model->add_record($data); $this->index(); }
I think this suits you better