Wednesday, August 19, 2015

How to Insert Data in Codeigniter

$this->db->query("UPDATE user_details SET FIRST_NAME = ?, LAST_NAME = ? WHERE USER_ID = ?", array($uRef['FIRST_NAME'], $uRef['LAST_NAME'], $uRef['USER_ID']));

  $this->db->query("INSERT INTO user_details (USER_ID, FIRST_NAME, LAST_NAME) VALUES (?, ?, ?)", array($userId, $fname, $lname));

        $this->db->query("INSERT INTO user_contact (USER_ID, FIRST_NAME,LAST_NAME) VALUES (?, ?, ?)", array($info['USER_ID'], $info['FIRST_NAME'], $info['LAST_NAME']));