title: Codeigniter error session DB
body: <p>After upgrade Codeigniter to version 3.0 I get error DB after trying call any controller:</p>
  
  <pre><code>Error Number: 1064
  
  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `id` = 'd1d384b0ceed0bd72fa210337acc666aab1a04e5'' at line 2
  
  SELECT `data` WHERE `id` = 'd1d384b0ceed0bd72fa210337acc666aab1a04e5'
  
  Filename: libraries/Session/drivers/Session_database_driver.php
  </code></pre>
  
  <p>When I reload page, I get that again with a other generated hash session. How to fix?</p>
  
  <p>In <code>config.php</code> I set session store: <code>$config['sess_driver'] = 'database';</code></p>
  
  <p>I looked at file where is a error(line 138):</p>
  
  <pre><code>public function read($session_id)
      {
          if ($this-&gt;_get_lock($session_id) !== FALSE)
          {
              // Needed by write() to detect session_regenerate_id() calls
              $this-&gt;_session_id = $session_id;
  
              $this-&gt;_db
                  -&gt;select('data')
                  -&gt;from($this-&gt;_config['save_path'])
                  -&gt;where('id', $session_id);
  
              if ($this-&gt;_config['match_ip'])
              {
                  $this-&gt;_db-&gt;where('ip_address', $_SERVER['REMOTE_ADDR']);
              }
  
              if (($result = $this-&gt;_db-&gt;get()-&gt;row()) === NULL) // Line 138
              {
                  $this-&gt;_fingerprint = md5('');
                  return '';
              }
  
              $this-&gt;_fingerprint = md5(rtrim($result-&gt;data));
              $this-&gt;_row_exists = TRUE;
              return $result-&gt;data;
          }
  
          $this-&gt;_fingerprint = md5('');
          return '';
      }
  </code></pre>