Jump to content

Error in Retrieving Data out of Database


ekuemoah
 Share

Recommended Posts

I have information in a php database. I want to retrieve it. The fields are text or memo fields meaning it can hold a lot of data. I got this error. When I retrieve the data, it only gives me the first record. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 35 bytes) in C:\Users\Public\EasyPHP-5.3.6.1\www\phptests\AccountingClass\PrintOutScript.php on line 19 What does this mean and what can I do about it? Thank You Also, i retrieved the first row of data but don't know how to print it out on my page.Here's the script I usedif($choice ='review'){$result=mysql_query("SELECT `Question` FROM `reviewquestions`");$row=mysql_fetch_array($result);//echo($row[1]);}

Edited by ekuemoah
Link to comment
Share on other sites

1) Echo is commented out, so you are going to get nothing.2) in your MySql query you have to refer to your DB connection. Ex-

$result_set = mysql_query("SELECT * FROM table WHERE user = {$user}, $connection);

Link to comment
Share on other sites

php has 128mb of memory by default for max memory allocation. Which is quite large. The error means that php hcant allocate more memory anymore. Post the exact code so that we can take a look into it. how many rows it is returning? what datat types of the column question? you can try also using mysql_free_result() to free up result resource.

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
 Share

×
×
  • Create New...