Data from database is overloading PHP's memory limit
<p>I'm developing a report where I write the syntax to retrieve data from database, but my result data is huge.  It's causing an error like this:</p>

<blockquote>
  <p>Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 2024 bytes)</p>
</blockquote>

<p>It's also displaying the report page slowly.</p>

<p>How I can solve this problem, avoid this error and make this page faster?</p>
