Hi, I'm doing an application with php codeigniter and sql server 2000. I try to make an insert to the bd and insert the data but the date you are saving is: 1894-07-07 00: 00: 00.0 (datetime) instead of the current date.
this is the code:
driver:
public function Save(){
$fk_idInd = $this->input->post('txtIdIind');
$fechaHora = date("m-d-Y");
$hora = $this->input->post('txtHora');
$estado = 1;
$rut_res = '123456';
$this->Indicaciones_model->insertControl($fk_idInd,$fechaHora,$estado,$rut_res);
}
model:
public function insertControl($fk_idInd,$fechaHora,$estado,$rut_res){
$sql = $this->db->query("INSERT INTO HCE_CONTROL_I_MED(FK_I_MED,FECHA_HORA,ESTADO,RUT_RES)
VALUES($fk_idInd,$fechaHora,$estado,$rut_res)");
return ($this->db->affected_rows() != 1) ? false : true;
}
Any ideas of what is happening?