title: NOTICE: Undefined index: Page
body: <p>I dont understand what im doing wrong, im getting this message:</p>
  
  <blockquote>
    <p>Notice: Undefined index: page in /Users/prinect/htdocs/sistema-noticias/classes/Article.php on line 221</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>public static function getList( $numRows=30, $order="publicationDate DESC" ) {
      $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
  
  
  
  $offset = ($_GET['page'] - 1) * $numRows;
      $rowCount = 20;
  
      $sql = "SELECT SQL_CALC_FOUND_ROWS *, UNIX_TIMESTAMP(publicationDate) AS publicationDate FROM articles
              ORDER BY {$order} LIMIT :offset, :rowCount";
  
  $st = $conn-&gt;prepare( $sql );
  $st-&gt;bindValue( ":rowCount", $rowCount, PDO::PARAM_INT );
  
  $st-&gt;bindValue( ":offset", $offset, PDO::PARAM_INT );
  
   $st-&gt;execute();
      $list = array();
  
      while ( $row = $st-&gt;fetch() ) {
        $article = new Article( $row );
        $list[] = $article;
      }
  
      // Now get the total number of articles that matched 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>