title: Memory limit of 10240 KB exceeded for buffered query
body: <p>Good day, I'm trying to <code>run queries</code> for my <code>searching</code> </p>
  
  <p>but i get this result </p>
  
  <blockquote>
    <p>Error Number: IMSSP/-59</p><p>Memory limit of 10240 KB exceeded for
    buffered query</p>
  </blockquote>
  
  <p>Here it's my query </p>
  
  <pre><code>SELECT * From transaksi a 
  left join Outlet b on a.Outlet = b.OutletCode
  left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
  and b.areacode like '%%' and b.OutletCode like '%%' and tanggal 
  between '2016-03-01' and '2016-07-31'
  </code></pre>
  
  <p>from my query above I get <code>16046 rows</code>. </p>
  
  <p>-- A Test --</p>
  
  <p>when I try to do some other search that only show <code>10 rows</code>, that error not showing. </p>
  
  <pre><code>SELECT * From transaksi a 
  left join Outlet b on a.Outlet = b.OutletCode
  left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
  and b.areacode like '%%' and b.OutletCode like '%K-SRLM%' and tanggal 
  between '2016-05-01' and '2016-05-10'
  </code></pre>
  
  <p>here it's not using <code>range</code> showing <code>411 rows</code></p>
  
  <pre><code>SELECT * From transaksi a 
  left join Outlet b on a.Outlet = b.OutletCode
  left join area c on b.areacode = c.areacode where b.BrandCode like  '%AR-1%'
  and b.areacode like '%%' and b.OutletCode like '%K-SRLM%'
  </code></pre>
  
  <p>Here it's my fullscript.</p>
  
  <pre><code>function show_it()
      {
          extract(populateform());
          if($date_search == "")
          {
              unset($date_search);
          }
          if(isset($date_search)){
          $explode = explode('-',$date_search);
          $start_date = inggris_date($explode[0]);
          $end_date = inggris_date($explode[1]);
          $result = $this-&gt;modelmodel-&gt;showdata("SELECT * From transaksi a 
                                                  left join Outlet b on a.Outlet = b.OutletCode
                                                  left join area c on b.areacode = c.areacode where b.BrandCode like  '%$tipenya%'
                                                  and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' and tanggal 
                                                  between '$start_date' and '$end_date'
                                                  ");
          }else{
          $result = $this-&gt;modelmodel-&gt;showdata("SELECT * From transaksi a 
                                                  left join Outlet b on a.Outlet = b.OutletCode
                                                  left join area c on b.areacode = c.areacode where b.BrandCode like '%$tipenya%'
                                                  and b.areacode like '%$area%' and b.OutletCode like '%$outlet%' 
                                                  ");
          }   
      }
  </code></pre>