Welcome Guest, Not a member yet? Register   Sign In
MySQL ActiveRecord - Protected identifier issue when updating?
#9

[eluser]gRoberts[/eluser]
It must be my setup as I have just uploaded a fresh copy of 1.7.2 downloaded today from CI and put the following code in (only changed the config/database files and added a controller)

Code:
$this->load->database();

            //create
            $cls = new stdClass();
            $cls->Key = 'class';
            $cls->SafeColumn = 'test';
            $this->db->insert('test', $cls);
            $cls->RowID = $this->db->insert_id();

            $arr = array();
            $arr['Key'] = 'array';
            $arr['SafeColumn'] = 'test';
            $this->db->insert('test', $arr);
            $arr['RowID'] = $this->db->insert_id();

            $cls->SafeColumn = 'changed';
            $this->db->update('test', $cls, array('RowID' => $cls->RowID));

            $arr['SafeColumn'] = 'changed';
            $this->db->update('test', $arr, array('RowID' => $arr['RowID']));

it worked :|

Thanks again Wink


Messages In This Thread
MySQL ActiveRecord - Protected identifier issue when updating? - by El Forum - 08-05-2010, 04:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB