[eluser]Todlerone[/eluser]
Hello all and TY in advance. I have two forms that add to the same MySql table. In my model I have tried to parse the data depending on which form they came from. When I try it I get a:
A Database Error Occurred
You must use the "set" method to update an entry.
I'm trying to insert new data, not alter existing data.
Code:
<?php
class Patients extends Model {
function Patients(){
parent::Model();
}
function add_schedule($ptID){
$da =array();
if ($this->input->post('sche_CDate') == TRUE){
$da = array(
'demo_NumID' => $ptID,
'sche_date' =>$this->input->post('sche_CDate'),
'sche_type' => 'con',
'sche_location' => 'jcc');
}
if ($this->input->post('sche_RDate') == TRUE){
$da = array(
'demo_NumID' => $ptID,
'sche_date' =>$this->input->post('sche_RDate'),
'sche_type' => 'ref',
'sche_location' => 'jcc');
}
if ($this->input->post('fromform') == 'yes'){
$da = array(
'demo_NumID' => $ptID,
'sche_date' => $this->input->post('sche_date'),
'sche_type' => $this->input->post('sche_type'),
'sche_location' => $this->input->post('sche_location'));
}
$this->db->insert('schedule', $da);
}
}
TY