title: PHP PDO fetching into objects
body: <p>I am trying to figure out how to fetch from PDO into my custom class, and in general the PDO-to-object API, and am finding the lack of decent documentation frustrating. Most of the options are only documented as an option, while the examples all use fetching into arrays.<br>
  So, can someone explain how these are used:</p>
  
  <ul>
  <li>PDO::FETCH_OBJ</li>
  <li>PDO::FETCH_CLASS</li>
  <li>PDO::FETCH_CLASSTYPE</li>
  <li>PDO::FETCH_INTO</li>
  <li>PDO::FETCH_LAZY</li>
  <li>PDOStatement::fetch</li>
  <li>PDOStatement::fetchObject</li>
  <li>PDOStatement::setFetchMode</li>
  </ul>
  
  <p>If possible, I would like a general explanation how each function/constant is used for fetching objects, or what the differences are, as well as a specific answer to how do I fetch into my class, e.g. into:</p>
  
  <pre><code>class MyRow {
    public $col1, $col2;
  }
  </code></pre>