title: PHP Pagination Limit
body: <p>In my controller I have the following code:</p>
  
  <pre><code>if($action=='shipping_list'){ 
      $numrows=inquire_row(); //Get number of rows in query
      $pages= new Paginator('10', 'p'); //create object
      $pages-&gt;set_total($numrows);
      $shipping=shipping_list(); //Goes to model
      include('shipping_list.php');
  }
  </code></pre>
  
  <p>In my model I these codes:</p>
  
  <pre><code>function shipping_list(){
      global $MEMS;
      global $pages;
          $query = "SELECT * FROM Inventory " .$pages-&gt;get_limit()
          ." WHERE Yield &gt;=320 AND (Q = 'Pass' OR Q='No Q') AND shipdate = ' '
          ORDER BY Wafer ASC, RC ASC";
      $shipping = $MEMS -&gt; query($query);
      return $shipping;
  }
  </code></pre>
  
  <p>The object get_limit is suppose to output a query that starts the query depends on what page the user is on:</p>
  
  <pre><code>public function __contruct($perPage, $instance){
      $this-&gt;_instance = $instance;       
  $this-&gt;_perPage = $perPage; 
  }
  
  public function get_limit(){
      return "LIMIT ".$this-&gt;get_start().",$this-&gt;_perPage";
  }
  </code></pre>
  
  <p>However, when I echo $query, I get the following:</p>
  
  <pre><code>SELECT * FROM Inventory LIMIT 0, WHERE Yield &gt;=320 AND (Q = 'Pass' OR Q='No Q') AND shipdate = ' ' ORDER BY Wafer ASC, RC ASC
  </code></pre>
  
  <p>So for some reason, the _perPage constant doesn't output. I'm new to OOP so any pointers would be appreciated.</p>