Posts

Showing posts from July, 2021

SQL queries in Cdeigniter

  Query for data insertion :      public function insert_department($data)     {         $this->db->insert('departments', $data);          //echo $this->db->last_query();exit;                     return true;     } Query for data updation : public function update_department($data, $id)     {         $this->db->where('id', $id);         $this->db->update('departments', $data);                      return true;     } Query for data updation : public function DeleteColors()     {         $this->db->where('id', $this->uri->segment(4));         $query = $this->db->delete('color_codes');                  ...

Set Base URL in config file in Codeigniter

  $config['base_url'] = "https://".$_SERVER['HTTP_HOST']; $config['base_url'] .= preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])).'/'; $config['index_page'] = ''; //Wirite below code in .htaccess file RewriteEngine on RewriteCond $1 !^(index\.php|public|\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?$1 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]