we are using PostGreSql database, when we run following code unit, it shows error of.
Severity: Warning
Message: Illegal string offset 'server'
Filename: postgre/postgre_driver.php
Message: Cannot modify header information - headers already sent by (output started at system/core/Exceptions.php:185)
Model Code:
public function tracks_add( $id ) {
$cnt = 0;
$date = date('Y-m-d H:i:s');
$s_title = $this->input->post('s_title');
$s_singer = $this->input->post('s_singer');
$s_url = $this->input->post('s_url');
foreach ($s_title as $s_title) {
$this->db->set( array('a_id'=> $id, 's_title' => $s_title, 's_singer' => $s_singer[$cnt], 's_url' => $s_url[$cnt], 'date'=> $date) );
$this->db->insert('soundtracks');
$cnt++;
}
}
You can find this issue here : Postgres db driver insert issue
Change line 331 to
$v = pg_version($this->conn_id); $v = isset($v['server']) ? $v['server'] : 0; // 'server' key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With