• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory limit of 10240 KB exceeded for buffered query

#1
Good day, I'm trying to `running a queries` for my `searching` 

but i get this result `<p>Error Number: IMSSP/-59</p><p>Memory limit of 10240 KB exceeded for buffered query</p>`

Here it's my query 

   
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'


from my query above i get `16046 rows`. when i try to do some other search that only showing `10 rows`, that error not showing and everything is working fine.

Here it's my fullscript.

   
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->modelmodel->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->modelmodel->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%' 
    ");
    }
    }

Any solution? sorry for my bad english. I'm using Sqlsrv
Reply

#2
That is a big result set and hence you appear to be reaching your server memory limit.

You can try changing it with a php.ini file (check with your host though), ( Something like ini_set("memory_limit","24M"); )

Alternatively, unless you really need 16,000 rows try limiting the results to the amount you need, say 20 rows for display with some sort of pagination system for navigating deeper.

Paul.
Reply

#3
10MB memory is too small value for limit (in your case this is set either by your server configuration or inside your code).

I think that for any PHP server, a minimum of 128MB memory should be configured at the start.
In common cases this amount is enough for everything.
Best VPS Hosting : Digital Ocean
Reply

#4
This could also be the MySQL ini setting.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#5
(07-01-2016, 04:19 AM)InsiteFX Wrote: This could also be the MySQL ini setting.

It's Microsoft SQL Server ... you're not paying attention at all, and not for the first time.
Reply

#6
That's because I like to get you going pulling your strings LOL!

2 good books to read Narf Games People Play - first and second editions.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.