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'),


    $this->HomeModel->update($data, $where);

This is my Model:

var $table = array('tracker.case_main,
//(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

People are also looking for solutions to the problem: php - Explode integer range with minuses


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.