title: Connect Codeigniter 3 with MS SQL Server
body: <p>I'm trying to connect Codeigniter 3 with Microsoft SQL Server 2008</p>
  
  <p>But I'm getting error <strong>Server error 500</strong>. </p>
  
  <p>I'm attaching code of database.php</p>
  
  <pre><code>$db['default'] = array(
  'dsn'   =&gt; 'Driver={SQL Server Native Client 10.0};Server=(local);Database=my_db;',
  'hostname' =&gt; '(local)',
  'port'     =&gt; '',
  'username' =&gt; '',
  'password' =&gt; '',
  'database' =&gt; '',
  'dbdriver' =&gt; 'odbc', // or mssql or sqlsrv
  'dbprefix' =&gt; '',
  'pconnect' =&gt; FALSE,
  'db_debug' =&gt; TRUE,
  'cache_on' =&gt; FALSE,
  'cachedir' =&gt; '',
  'char_set' =&gt; 'utf8',
  'dbcollat' =&gt; 'utf8_general_ci',
  'swap_pre' =&gt; '',
  //'autoinit' =&gt; TRUE,
  'encrypt' =&gt; FALSE,
  'compress' =&gt; FALSE,
  'stricton' =&gt; FALSE,
  'failover' =&gt; array(),
  'save_queries' =&gt; TRUE
   );
  </code></pre>
  
  <p>I tried to connect simple core php file with MS SQL and it is connect successfully.</p>
  
  <p>Following is the core PHP file code.</p>
  
  <pre><code>&lt;?php
  // Replace the value of these variables with your own data
  $user = '';
  $pass = '';
  $server = "(local)";
  $database = 'h2g2';
  
  // No changes needed from now on
  $connection_string = "DRIVER={SQL Server};SERVER=$server;DATABASE=$database"; 
  $conn = odbc_connect($connection_string,$user,$pass);
  
  if ($conn) {
      echo "Connection established.";
  
      $sql = "INSERT INTO hg_users (u_uuid,u_name, u_email,u_new_email,u_password,u_display_name,u_forgot_token,u_forgot_token_request_time,u_verify_token,u_verified,u_last_login_date,u_last_login_ip,u_created_date,u_modified_date,u_status) 
                          VALUES ('1231233', '123123123 sdfsdfdsdf','ASsASas','asdasd','asd','ewrt','fgh','sdfgsasd','asdasd','2','zx','ZXcZX','aSzxCASD','ASDzxzx','1');";
  
      $result = odbc_exec($conn,$sql);
      echo "&lt;pre&gt;";print_r($result);
      die;
  
  } else{
      die("Connection could not be established.");
  }
  ?&gt;
  </code></pre>
  
  <p>I'm using PHP 5.6 and Sql server 2008 with Xampp, Windows 7 32 bit.</p>