Welcome Guest, Not a member yet? Register   Sign In
appending record instead of replacing field
#1

I am trying to update one field of a table.
PHP Code:
       $userid=$this->session->userdata('userid');
 
       $campaign=$this->session->userdata('campaign');
 
       $sql="SELECT * FROM users WHERE email = ?";
 
       $query $this->db->query($sql,$userid);
 
       $row $query->row();
 
       $iRc=$this->db->replace('users',array('campaign'=> $campaign)); 
I am finding that this is appending a new record onto the end of the table rather than replacing the campaign field if the userid matches. This is the table structure. What is the problem?

Attached Files Thumbnail(s)
   
proof that an old dog can learn new tricks
Reply


Messages In This Thread
appending record instead of replacing field - by richb201 - 01-19-2019, 10:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB