title: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 20 datatype mismatch' in /media/Data/Documenten/PHP/µBot/index.php:100
body: <p>I keep getting this error message. The datatype it's talking about is <em>TEXT</em> and the data to insert is <em>TEXT</em> so I don't see what could be the problem.</p>
  
  <pre><code>robin@robin-Latitude-D620:/media/Data/Documenten/PHP/µBot$ php index.php 
  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
  PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 20 datatype mismatch' in /media/Data/Documenten/PHP/µBot/index.php:100
  Stack trace:
  #0 /media/Data/Documenten/PHP/µBot/index.php(100): PDOStatement-&gt;execute()
  #1 /media/Data/Documenten/PHP/µBot/index.php(73): addToLog('439', '*', 'irc.gmake.org', ':Please wait wh...')
  #2 {main}
    thrown in /media/Data/Documenten/PHP/µBot/index.php on line 100
  </code></pre>
  
  <p>Block of code where the problem should lie (line 100 is the last line of this block):</p>
  
  <pre><code>function addToLog($type, $channel, $host, $message)
  {
      global $database;
      $temp = explode('!', $host);
      $nick = $temp[0];
      unset($temp);
      $timestamp = time();
      $nickprefix = '';
      $query = $database-&gt;prepare("INSERT INTO log VALUES ('', :channel, :nick, :host, :message, :type, :time, '');");
      $query-&gt;bindParam(':channel', $channel);
      $query-&gt;bindParam(':nick', $nick);
      $query-&gt;bindParam(':host', $host);
      $query-&gt;bindParam(':message', $message);
      $query-&gt;bindParam(':type', $type);
      $query-&gt;bindParam(':time', $timestamp); 
      $query-&gt;execute();
  }
  </code></pre>
  
  <p>Full code: <a href="http://pastebin.com/CXCQjqb0" rel="nofollow">http://pastebin.com/CXCQjqb0</a></p>
  
  <p>--</p>
  
  <p>SQLite version: sqlite 2.8.17-6.1ubuntu1<br />
  PHP version: php5-common 5.3.6-13ubuntu3.2</p>