title: displaying data from a users table and a leads table
body: <p>I have a <code>users</code> table with <code>id</code> as the Primary Key and a <code>leads</code> table with <code>id</code> as the Foreign Key. I want to display the information from the users table by the <code>users</code>'s <code>id</code> along with the <code>id</code> from the <code>leads</code> table:</p>
  
  <pre><code>public function query($sql, $params = array()) {
  
      $this-&gt;_error = false;
  
      if($this-&gt;_query = $this-&gt;_pdo-&gt;prepare($sql)) {
          $x = 1;
          if(count($params)) {
              foreach($params as $param) {
                  $this-&gt;_query-&gt;bindValue($x, $param);
                  $x++;
              }
          }
  
          if($this-&gt;_query-&gt;execute()) {
              $this-&gt;_results = $this-&gt;_query-&gt;fetchAll(PDO::FETCH_OBJ);
              $this-&gt;_count = $this-&gt;_query-&gt;rowCount();
          } else {
              $this-&gt;_error = true;
          }
      }
  
      return $this;
  }
  
  public function get($table, $where) {
      return $this-&gt;action('SELECT *', $table, $where);
  }
  </code></pre>