title: Try Manual Connection
body: <p>I have a form with fields to make a connection to the database using CodeIgniter. The data is filled in by the users in the form.
  Is it possible to know if the connection is established or not?</p>
  
  <pre><code>$drive      = $this-&gt;input-&gt;post('drive');
  $hostname   = $this-&gt;input-&gt;post('hostname');
  $database   = $this-&gt;input-&gt;post('database');
  $username   = $this-&gt;input-&gt;post('username');
  $password   = $this-&gt;input-&gt;post('password');
  $base       = $this-&gt;input-&gt;post('base');
  
  $db = array(
                  'hostname' =&gt; $hostname,
                  'username' =&gt; $username,
                  'password' =&gt; $password,
                  'database' =&gt; $database,
                  'dbdriver' =&gt; $drive,
                  'db_debug' =&gt; FALSE);
  
         $cn =  $this-&gt;load-&gt;database($db);
  
  if ($cn) { echo 'ok'; } else {echo 'nops';} 
  </code></pre>