Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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);
   }
Comment

update codeigniter

$this->db->set('fieldname', 'value');
$this->db->where('id', 2);
$this->db->update('tablename');
Comment

PREVIOUS NEXT
Code Example
Php :: check duplicate data in array php 
Php :: php loop array 
Php :: reply to wp_mail 
Php :: ver version de php en linux 
Php :: return two variables php 
Php :: wordpress deactivate widgets gutenberg 
Php :: check if variable is set and not empty laravel 
Php :: Laravel stop on first validation error 
Php :: laravel blank page 
Php :: php check if string ends with 
Php :: laravel query order by relation 
Php :: add json extenstion php 
Php :: currency format in laravel 
Php :: accessing json data in php 
Php :: session not working php 
Php :: php check if all array values are the same 
Php :: laravel model with migration 
Php :: laravel livewire-datatable delete column pop up issue 
Php :: laravel passport vue 401 Unauthorized 
Php :: convert_uudecode (PHP 5, PHP 7, PHP 8) convert_uudecode — Decode a uuencoded string 
Php :: php regular expression function 
Php :: laravel run all seeders 
Php :: reset id auto increment after deleting a table row in phpmyadmin 
Php :: custom autoload without composer php psr4 
Php :: has password argon2i 
Php :: json stringify to php array 
Php :: composer create project 
Php :: laravel file store 
Php :: isempty php 
Php :: php bulk insert mysql 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =