Answers for "update where and condition codeigniter 4"

PHP
0

update query in codeigniter using where condition

public function update_row(){
		
		$update_rows = array('field-name' => 'field-data',);
		$this->db->where('id', 1 );
		$this->db->update('table-name', $update_rows);	

	}
Posted by: Guest on July-15-2020
0

codeigniter update or create

$this->db->where('user_id',$id);
   $q = $this->db->get('profile');

   if ( $q->num_rows() > 0 ) 
   {
      $this->db->where('user_id',$id);
      $this->db->update('profile',$data);
   } else {
      $this->db->set('user_id', $id);
      $this->db->insert('profile',$data);
   }
Posted by: Guest on September-08-2021

Code answers related to "update where and condition codeigniter 4"

Browse Popular Code Answers by Language