在codeigniter如何检查更新?

if($this->db->affected_rows()>0){
            return TRUE;
        }else{
            return FALSE;
        }

but in that case, if user dose not changed before information that in db's Info, it does not update.

So always return 0;

I want check update's Successful or fail

How I can Check?

Just use check like this

if($this->db->affected_rows()>=0){} 

The best way is use transaction mechanism of codeigniter as below:

$this->db->trans_begin();//begins your transaction
$data =<data> //data for upadating
$this->db->where('id', $id);//where condition
$this->db->update('table_name',$data);//update query

 if ($this->db->trans_status() === FALSE)//checks transaction status
    {
        $this->db->trans_rollback();//if update fails rollback and  return false
       return FALSE;

    }
    else
    {
        $this->db->trans_commit();//if success commit transaction and returns true
        return TRUE;
    }