Fatal error: Call to a member function bindParam()
<p>I am learning to work with PHP and have a simple problem.</p>

<pre><code>&lt;?php
   ini_set('display_errors', 'On');
  error_reporting(E_ALL);
  $db = new PDO('sqlite:/usr/users2/mieic2009/ei09072/public_html/TP1/Delicious    /Database.db');
   $a = $_GET['linkRef'];
   $b = $_GET['tagToAdd'];

   $checkIdLink = $db-&gt;prepare('SELECT idLink FROM Links WHERE nome_L = :link_n;');
   $checkIdLink-&gt;bindParam(':link_n', $a, PDO::PARAM_STR);
   $checkIdLink-&gt;execute();
   $linkID = $checkIdLink-&gt;fetch();

   $insertLink = $db-&gt;prepare('INSERT INTO Tags (nome_T, idLink) VALUES (:addTag, :link_id)');
   $insertLink-&gt;bindParam(':addTag', $b, PDO::PARAM_STR);
   $insertLink-&gt;bindParam(':link_id', $linkID, PDO::PARAM_INT);
   $insertLink-&gt;execute();

    echo 'Tag added to the specified link!';
?&gt;
</code></pre>

<p>This code should add a Tag to an existing link in a database, however I am getting this error</p>

<blockquote>
  <p>Fatal error: Call to a member function bindParam() on a non-object in
  /usr/users2/mieic2009/ei09072/public_html/TP1/Delicious/addTag.php on
  line 9</p>
</blockquote>

<p>I have checked over and over and can't seem to find what's wrong with this code, I googled for this error but unfortunately the answer I found weren't helpful enough. Any help would be appreciated, this is probably a simple rookie mistake.</p>
