title: Basic pdo oop in php
body: <p>I'm new in php oop..I'm having trouble in showing my fields value. I have here the ff classes.</p>
  
  <pre><code>public static function getAll()
  {
  
      self::conn();
  
      try
      {
  
          $sql = "SELECT * FROM dbo.guitar";
  
          $q = self::$db-&gt;prepare($sql);
          $q-&gt;execute();
          $results = $q-&gt;fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE,
                  "Guitar",
                  array('id', 'make', 'model', 'colour', 'price'));
  
      }
      catch (Exception $e)
      {
          print "Error!: " . $e-&gt;getMessage();
      }
  
      return $results;    
  }
  </code></pre>
  
  <p>I want it to show from diff fields. Here is my code:</p>
  
  <pre><code>$guitars = Guitar::getAll();
  </code></pre>
  
  <p>I can see the values when I try using the <code>print_r</code></p>
  
  <p>What I want is like this.</p>
  
  <pre><code>echo $row['field1'];  echo $row['field2']; 
  </code></pre>
  
  <p>THank you in advance.</p>