Jump to content

memory size exhausted on mysql


funbinod

Recommended Posts

I was retrieving only one row from a table. in localhost it gave good result. but while using online, it says memory size exhausted. perhaps there are different settings on my localhost and webhost regarding memory size. but I wondered that how can the memory be exhausted while retrieving information from only one row? or there is problem in my query??

 

the following is the query I used.

$sql = "SELECT icode,item,description,catid,unitid,pprice,sprice,oqty,oprice,bcode,oamt FROM stock WHERE sid=? AND cid=?";if($stmt = $mysqli->prepare($sql)) {	$stmt->bind_param('si', $sid, $cid);	$stmt->execute();	$stmt->bind_result($icode,$items,$desc,$catid,$unitid,$pprice,$sprice,$oqty,$oprice,$bcode,$oamt);	$stmt->fetch();	$stmt->free_result();}

is there any problem in my statement that uses highest memory??

Link to comment
Share on other sites

If there's not much other code on that page then I guess it's possible that the data in your database is so large that it would use all of the memory that PHP has availble. You can change the memory limit though. If there's more code that runs then maybe something else is using most of the memory, and that query is just using the rest. You can use this to see how much memory is being used at any point:http://php.net/manual/en/function.memory-get-usage.php

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...