• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DB realted small Qs

#1
[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.

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

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

Thank you man....I'll try


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.