title: You have specified an invalid database connection group codeigniter error
body: <p>i'm making a CRUD from a tutorial. And i'm getting this error.</p>
  
  <blockquote>
    <p><strong>You have specified an invalid database connection group.</strong></p>
  </blockquote>
  
  <p>What would be the problem?</p>
  
  <p><em><strong>database.php</em></strong> - database config</p>
  
  <pre><code>$db['default']['hostname'] = 'localhost';
  $db['default']['username'] = 'root';
  $db['default']['password'] = '';
  $db['default']['database'] = 'cicrud';
  $db['default']['dbdriver'] = 'mysql';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  </code></pre>
  
  <p><strong>users_model.php</strong> -model</p>
  
  <pre><code>&lt;?php
  
  class Users_model extends CI_Model {
  
  function __construct()
  
  {
  
  parent::__construct();
  
  $this-&gt;load-&gt;database('cicrud');
  
  }
  
  public function get_all_users()
  
  {
  
  $query = $this-&gt;db-&gt;get('users');
  
  return $query-&gt;result();
  
  }
  public function insert_users_to_db($data)
  
  {
  
  return $this-&gt;db-&gt;insert('users', $data);
  
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>users.php</strong> - controller</p>
  
  <pre><code>&lt;?php
  
  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Users extends CI_Controller {
  
  function __construct()
  
  {
  
  parent::__construct();
  
  #$this-&gt;load-&gt;helper('url');
  
  $this-&gt;load-&gt;model('users_model');
  
  }
  
  public function index()
  
  {
  
  $data['user_list'] = $this-&gt;users_model-&gt;get_all_users();
  
  $this-&gt;load-&gt;view('show_users', $data);
  
  }
  public function add_form()
  
  {
  
  $this-&gt;load-&gt;view('insert');
  
  }
  public function insert_new_user()
  
  {
  
  $udata['name'] = $this-&gt;input-&gt;post('name');
  
  $udata['email'] = $this-&gt;input-&gt;post('email');
  
  $udata['address'] = $this-&gt;input-&gt;post('address');
  
  $udata['mobile'] = $this-&gt;input-&gt;post('mobile');
  
  $res = $this-&gt;users_model-&gt;insert_users_to_db($udata);
  
  if($res){
  
  header('location:'.base_url()."index.php/users/".$this-&gt;index());
  
  }
  
  }
  }
  </code></pre>
  
  <p><strong>show_users.php</strong> - html views</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  
  &lt;title&gt;CI CRUD&lt;/title&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function show_confirm(act,gotoid)
  
  {
  
  if(act=="edit")
  
  var r=confirm("Do you really want to edit?");
  
  else
  
  var r=confirm("Do you really want to delete?");
  
  if (r==true)
  
  {
  
  window.location="&lt;?php echo base_url();?&gt;index.php/users/"+act+"/"+gotoid;
  
  }
  
  }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;h2&gt; Simple CI CRUD Application &lt;/h2&gt;
  
  &lt;table width="600" border="1" cellpadding="5"&gt;
  
  &lt;tr&gt;
  
  &lt;th scope="col"&gt;Id&lt;/th&gt;
  
  &lt;th scope="col"&gt;User Name&lt;/th&gt;
  
  &lt;th scope="col"&gt;Email&lt;/th&gt;
  
  &lt;th scope="col"&gt;Mobile&lt;/th&gt;
  
  &lt;th scope="col"&gt;Address&lt;/th&gt;
  
  &lt;th scope="col" colspan="2"&gt;Action&lt;/th&gt;
  
  &lt;/tr&gt;
  
  &lt;?php foreach ($user_list as $u_key){ ?&gt;
  
  &lt;tr&gt;
  
  &lt;td&gt;&lt;?php echo $u_key-&gt;id; ?&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;?php echo $u_key-&gt;name; ?&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;?php echo $u_key-&gt;email; ?&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;?php echo $u_key-&gt;address; ?&gt;&lt;/td&gt;
  
  &lt;td&gt;&lt;?php echo $u_key-&gt;mobile; ?&gt;&lt;/td&gt;
  
  &lt;td width="40" align="left" &gt;&lt;a href="#" onClick="show_confirm('edit',&lt;?php echo $u_key-&gt;id;?&gt;)"&gt;Edit&lt;/a&gt;&lt;/td&gt;
  
  &lt;td width="40" align="left" &gt;&lt;a href="#" onClick="show_confirm('delete',&lt;?php echo $u_key-&gt;id;?&gt;)"&gt;Delete &lt;/a&gt;&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;?php }?&gt;
  
  &lt;tr&gt;
  
  &lt;td colspan="7" align="right"&gt; &lt;a href="&lt;?php echo base_url();?&gt;index.php/user/add_form"&gt;Insert New User&lt;/a&gt;&lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;/table&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>