Hi, I'm working on Code Igniter from php and I need to multiply the number I send from the front with the total data in a column lenght
it has the name id
and is auto incretable.
try this, from model:
function InsertRegistro($data){
$this->db->insert('mascalo',$data);
$this->db->select_max('id');
$query = $this->db->get('mascalo');
return $query->row();
}
and from the controller:
public function getdatoCHILE(){
$data = array(
'total' => $this->input->post('total'),
'hash' => $this->input->post('hash')
);
$this->load->model('Model_app');
$largo = $this->Model_app->InsertRegistro($data);
if ($data==null) {
$this->_app_output($this->error);
}
else {
$dinero= $data['total'];
$numero = $largo * $dinero
header('Content-Type: application/json');
echo json_encode($numero);
}
}
Help please! Greet me once again.