CodeIgniter Forums
You must use the "set" method to update an entry - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: You must use the "set" method to update an entry (/showthread.php?tid=82264)



You must use the "set" method to update an entry - Artsiom - 06-26-2022

Codeigniter 2.2.2
No changes were made to the site code on the site, only work was carried out through the site admin panel to add information to the site. I do not understand why this error appeared, since before that everything worked correctly. This may have happened because a new ssl certificate was installed.
Error: You must use the set method to update a record. File name: admin_m.php Line number: 25
This error occurs when you try to edit information on the site through the admin panel.

PHP Code:
function getInfo()
    {
        $this->db->select();
        $this->db->from('tbl_info');
        $this->db->where('id'1);
        $query $this->db->get();
        
        
return $query->result();
    }
    function editInfo($data)
    {  
    
        $this
->db->where('id'1);
        $this->db->update('tbl_info'$data); // the error refers to the given line of code
        return TRUE;
    



RE: You must use the "set" method to update an entry - InsiteFX - 06-27-2022

PHP Code:
function editInfo($data)
{
  
    $this
->db->set($data);    
    $this
->db->where('id'1);
    $this->db->update('tbl_info'$data); // the error refers to the given line of code

    return TRUE;