php - How to UPDATE Multiple table using Postgresql & Codeigniter
I have data in the form of array and i want them to be updated into multiple table. Im using Codeigniter and Postgresql
Here is my controller
public function update()
{
$where = array(
'id' => $this->input->post('id')
);
$data = array(
'case_name' => $this->input->post('txtCaseName'),
'firm_name' => $this->input->post('txtFirmName'),
'case_description' => $this->input->post('txtCaseOverview'),
'service_names' => $this->input->post('txtDesiredServices'),
'instruction' => $this->input->post('txtinstruction'),
);
//print_r($data);
//die;
$this->HomeModel->update($data, $where);
This is my Model:
var $table = array('tracker.case_main,
tracker.case_overview,
tracker.type_of_services,
tracker.instructions');
//(tracker is my scheme name)
public function update($data, $where)
{
$this->db->update($this->table, $data, $where);
return $this->db->affected_rows();
}
Error im receiving :
Error Number: 42601/7 ERROR: syntax error at or near "Array" LINE 1: UPDATE Array SET "case_name" = 'Mary Garner', "firm_name" =... ^
UPDATE Array SET "case_id" = 'Medidoco_001sa', "case_name" = 'Mary Garner', "firm_name" = 'xyz', "case_description" = '', "service_names" = '', "instruction" = '', WHERE "id" = '78'
Filename: C:/xampp/htdocs/casetrackings/system/database/DB_driver.php
Line Number: 691
im new to php and codeigniter :P