title: php pdo selecting from multiple tables with more than one where clauses
body: <p>I am new to PHP PDO and converting some regular MySQL queries to work with PDO.</p>
  
  <p>The query below when tested in phpMyAdmin works great when the assigned values replaced the current placeholders in the SQL statement. But when I configure it to work as it is now with PDO, it does not produce any results or errors. Can someone please tell me or show me what is it that I am doing wrong? </p>
  
  <p>Someone told me that I cannot pass parameters as references in the array.</p>
  
  <p>And if correct, what is the best way for creating a solution and by using only the user ID passed through to the variable <code>$uid</code>. Thanks.</p>
  
  <pre><code>&lt;p&gt;// For testing&lt;/p&gt;
  &lt;pre&gt;$uid = 1;&lt;/pre&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;   
  &lt;pre&gt;$array = array(
      ':uId' =&gt; ''.$uid.'',
      ':aId' =&gt; 'u.user_id',
      ':gID' =&gt; 'a.group_id',
      ':eID' =&gt; 'a.entry_id',
      ':pID' =&gt; 'a.permit_id'
      );&lt;/pre&gt;
  </code></pre>
  
  <p><p>&nbsp;</p>
     <p>// create the sql for qd_user_usam table</p>
      <pre>$sql = "SELECT u.user_id, a.acl_id, g.group_name, e.entry_level, p.permit_level</pre> 
              <pre>FROM qd_users as u, qd_users_acl as a, qd_users_group as g, qd_users_entry as e, qd_users_permission as p </pre>
              <pre>WHERE u.user_id = :uID
              AND a.acl_id    = :aID 
              AND g.group_id  = :gID
              AND e.entry_id  = :eID
              AND p.permit_id = :pID";</pre></p>
  
  <pre><code>&lt;p&gt;try
  {&lt;/p&gt;
     &lt;p&gt;// Build the database PDOStatement&lt;/p&gt;
     &lt;pre&gt;$_stmt = $this-&gt;_dbConn-&gt;prepare($sql);&lt;/pre&gt;
     &lt;pre&gt;$_stmt-&gt;execute($array);&lt;/pre&gt;
  &lt;pre&gt;}
  catch(PDOException $e)
  {&lt;/pre&gt;
      &lt;pre&gt;$this-&gt;_errorMessage .= 'Error processing user login access. &lt;br /&gt; Line #'.__LINE__ .' '.$e ;&lt;/pre&gt;  
      &lt;pre&gt;die($this-&gt;_errorMessage);
  }&lt;/pre&gt;
  
  &lt;pre&gt;$results = $_stmt-&gt;fetchAll(PDO::FETCH_ASSOC);&lt;/pre&gt;
  &lt;pre&gt;return $results;&lt;/pre&gt;
  
  &lt;pre&gt;$results = null;&lt;/pre&gt;
  &lt;pre&gt;$this-&gt;_dbConn = null;&lt;/pre&gt;
  </code></pre>