title: Magento - $_orders = Mage::getResourceModel outputs the SQL string - Recent.php
body: <p>I'm trying to output more orders on the front end of /customer/account Recent Orders grid.</p>
  
  <p>The code in /Mage/Sales/Order/Block/Recent.php says this</p>
  
  <pre><code>&lt;?php  $_orders = Mage::getResourceModel('sales/order_collection')
          -&gt;addAttributeToSelect('*')            
          -&gt;joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
          -&gt;joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
          -&gt;addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getId())
          -&gt;addAttributeToFilter('state', array('in' =&gt; Mage::getSingleton('sales/order_config')-&gt;getVisibleOnFrontStates()))
          -&gt;addAttributeToSort('created_at', 'desc')
          -&gt;setPageSize(5)        
          -&gt;load();
  ?&gt;  
  </code></pre>
  
  <p>When I edit number ->load(10) it outputs a string of the query that was created. There is no echo anywhere in Recent.php</p>
  
  <p>It also does not add 10 Orders, just stays at default 5. What am I missing?</p>
  
  <p>I tried putting this straight into recent.phtml</p>
  
  <pre><code>&lt;?php  $_orders = Mage::getResourceModel('sales/order_collection')
          -&gt;addAttributeToSelect('*')            
          -&gt;joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
          -&gt;joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
          -&gt;addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')-&gt;getCustomer()-&gt;getId())
          -&gt;addAttributeToFilter('state', array('in' =&gt; Mage::getSingleton('sales/order_config')-&gt;getVisibleOnFrontStates()))
          -&gt;addAttributeToSort('created_at', 'desc')
          -&gt;setPageSize('10')        
          -&gt;load('10');
  ?&gt;  
  </code></pre>
  
  <p>And it changes the number of orders to 10, but still outputs the SQL query.</p>
  
  <p><strong>Query</strong></p>
  
  <pre><code>SELECT `main_table`.* FROM `sales_flat_order` AS `main_table` WHERE (main_table.customer_id = '1') AND (state IN('new', 'processing', 'complete', 'closed', 'canceled', 'holded', 'payment_review')) ORDER BY created_at DESC LIMIT 10 10 
  </code></pre>
  
  <p>Any ideas?</p>