title: PDO returning nothing
body: <p>So basically I've started working with OOP and the script I've wrote based on a tutorial is giving me 2 problems:</p>
  
  <p>When i try to convert an object into a variable i'm getting this error:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in /home/stream/V2/templates/homepage.php on line 14</p>
  </blockquote>
  
  <p>The code on line 14 is:</p>
  
  <pre><code>&lt;a href=".action=viewSeries&amp;amp;seriesId=&lt;?php echo $series-&gt;id ?&gt;"&gt;&lt;?php echo htmlspecialchars( $series-&gt;id ) ?&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Second instead of turning the object into a variable and trying to access data directly from it i'm getting nothing.</p>
  
  <p>I basically have 3 pages to help get data from a table:</p>
  
  <p><strong>Homepage.php</strong></p>
  
  <pre><code>    &lt;?php include( "templates/include/header.php" ); ?&gt;
  
      &lt;ul id="headlines"&gt;
  
      &lt;?php
      echo $results['totalRows'];
      foreach( $results['series'] as $series ){ ?&gt;
  
      &lt;li&gt;
      &lt;h2&gt;
      &lt;!-- remember to add htmlspecialchars --&gt;
      &lt;span class="title"&gt;&lt;?php echo $results['series']-&gt;description ?&gt;&lt;/span&gt; 
  
      &lt;a href=".action=viewSeries&amp;amp;seriesId=&lt;?php echo $series-&gt;id ?&gt;"&gt;&lt;?php echo htmlspecialchars( $series-&gt;id ) ?&gt;&lt;/a&gt;
      &lt;/h2&gt;
      &lt;/li&gt;
  
  
      &lt;?php 
      } ?&gt;
  
      &lt;/ul&gt;
  
      &lt;p&gt;&lt;a href="./?action=archive"&gt;Series Archive&lt;/a&gt;&lt;/p&gt;
      &lt;?php include( "templates/include/footer.php" ); ?&gt;
  </code></pre>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>    &lt;?php
  
  require( "core/config.php" );
  $action = isset ( $_GET['action'] ) ? $_GET['action'] : "";
  
  switch ( $action ){
      case 'series':
          series();
      break;
  
      case 'viewSeries':
          viewSeries();
      break;
  
      default:
          homepage();
  }
  
  function series(){
      $results = array();
      $data = Series::getList();
      $results['series'] = $data['results'];
      $results['totalRows'] = $data['totalRows'];
      $results['pageTitle'] = "Series Title";
      require( TEMPLATE_PATH . "/series.php" );
  }   
  
  function viewSeries(){
      if( !isset( $_GET['seriesId'] ) || !$_GET['seriesId'] ){
          homepage();
          return;
      }
  
      $results = array();
      $results['series'] = Series::getBydId( (int)$_GET['seriesId'] );
      $results['pageTitle'] = $results['series']-&gt;title . "| Sub title";
      require( TEMPLATE_PATH . "/viewSeries.php" );
  }
  
  function homepage(){
      $results = array();
      $data = Series::getList( HOMEPAGE_NUM_SERIES );
      $results['series'] = $data['results'];
      $results['totalRows'] = $data['totalRows'];
      $results['pageTitle'] = "Streamaton Homepage";
      require( TEMPLATE_PATH . "/homepage.php");
  }
  </code></pre>
  
  <p><strong>And this is the piece of code from the Series.php class:</strong></p>
  
  <pre><code>    //Return all (or range of) Series objects in the db
  public static function getList( $numRows=100000, $order="id DESC" ){
      $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
      $sql = "SELECT id, description FROM series ORDER BY :order LIMIT :numRows";
      //SQL_CALC_FOUND_ROWS *
      $st = $conn-&gt;prepare( $sql );
      $st-&gt;bindValue( ":numRows", $numRows, PDO::PARAM_INT );
      $st-&gt;bindValue( ":order", $order, PDO::PARAM_STR );
      $st-&gt;execute();
      $list = array();
  
      while( $row = $st-&gt;fetch() ){
          $series = new Series( $row );
          $list = $series;    
      }
  
  
      //Now get the total number of series that match the criteria
      $sql = "SELECT FOUND_ROWS() AS totalRows";
      $totalRows = $conn-&gt;query( $sql )-&gt;fetch();
      $conn =  null;
      return ( array ( "results" =&gt; $list, "totalRows" =&gt; $totalRows[0] ) );
  
  }
  </code></pre>
  
  <p><strong>The whole series.php code looks like this: <a href="http://pastebin.com/f95A8NPr" rel="nofollow">http://pastebin.com/f95A8NPr</a></strong></p>