CodeIgniter Forums
DB realted small Qs - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: DB realted small Qs (/thread-9391.html)



DB realted small Qs - El Forum - 06-24-2008

[eluser]Yash[/eluser]
Code:
$data = array(
               'Activate' => 1,
               'CheckCode' => ""
            );

            
    $this->db->where(array('MemberID'=> $id,'CheckCode'=> $act_code));
    $str1 =$this->db->update('users', $data);

this works perfectly.

but problem is each time $str1 gives 1 whether it updates or not .

My question how to do this also know whether query is successful or not.


DB realted small Qs - El Forum - 06-24-2008

[eluser]xwero[/eluser]
$this->db->affected_rows()


DB realted small Qs - El Forum - 06-24-2008

[eluser]Yash[/eluser]
You always rocks Smile

Thank you man....I'll try