CodeIgniter Forums
writing to database is failing but why? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: writing to database is failing but why? (/showthread.php?tid=84911)



writing to database is failing but why? - richb201 - 11-22-2022

I am trying to update a field called fourparttest in the business_component table.  I am not getting an error,but the new data (which should be 4) doesn;t seem to update the database which is mysql on RDS. 

       $data=NULL;
        $data = array(
            'fourparttest' => $iComplete  //this is an int
            );
        $this->db->where('campaign =', $this->session->userdata('campaign'));
        $this->db->where('email =', $this->session->userdata('userid'));
        $this->db->where('bus_comp =', $post_array->bus_comp);
        $this->db->where('taxyear =', $post_array->taxyear);
        $iRc=$this->db->update('business_components',$data);

I can't seem to create a log file either.


RE: writing to database is failing but why? - kenjis - 11-22-2022

You can get the last query:
PHP Code:
$this->db->last_query();