title: PDO Storing Array using Memcache
body: <p>I'm trying to store an array in the cache, however I'm getting the error:</p>
  
  <blockquote>
    <p>md5() expects parameter 1 to be string, object given in</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>function getList(){
          global $meminstance;
  
          $query = $this-&gt;connection-&gt;prepare("SELECT id FROM " . TBL_LIST . " ORDER BY name");
          $query_key = "KEY" . md5($query);
          $list = $meminstance-&gt;get($query_key);
  
          if (!$list){
              $query = $this-&gt;connection-&gt;query("SELECT id FROM " . TBL_LIST . " ORDER BY name");
              $list = $query-&gt;fetch(PDO::FETCH_ASSOC); 
              $meminstance-&gt;set($query_key, $list, 0, 600);
          }
          return $list;
      }
  </code></pre>
  
  <p>What does the error mean? What am I doing wrong?</p>