Answers for "update where codeigniter 4"

PHP
0

codeigniter update

$data = [
        'title' => $title,
        'name'  => $name,
        'date'  => $date
];

$builder->where('id', $id);
$builder->update($data);
// Produces:
//
//      UPDATE mytable
//      SET title = '{$title}', name = '{$name}', date = '{$date}'
//      WHERE id = $id
Posted by: Guest on December-30-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
0

codeigniter 3 update

$data = array(
        'title' => $title,
        'name' => $name,
        'date' => $date
);

$this->db->where('id', $id);
$this->db->update('mytable', $data);
Posted by: Guest on November-06-2020

Code answers related to "update where codeigniter 4"

Browse Popular Code Answers by Language