title: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3 bytes) after ini_set
body: <p>At first, I've already looked at <a href="https://stackoverflow.com/questions/561066/php-fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter">this</a>, <a href="https://stackoverflow.com/questions/5061917/ini-setmemory-limit-in-php-5-3-3-is-not-working-at-all">this</a> and <a href="https://stackoverflow.com/questions/12264253/allowed-memory-size-of-134217728-bytes-exhausted">this</a>.</p>
  
  <p>I've received the following error:</p>
  
  <p><code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 220 bytes)</code></p>
  
  <p>I'm working with <code>php 5.4</code>and <code>sql Anywhere 11</code>.</p>
  
  <p>The solution to this is according to <a href="https://stackoverflow.com/questions/561066/php-fatal-error-allowed-memory-size-of-134217728-bytes-exhausted-codeigniter">this</a> is putting <code>ini_set('memory_set',-1);</code> in my <code>php-file</code>, but after doing this I get another error:</p>
  
  <p><code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3 bytes)</code></p>
  
  <p><strong>EDIT</strong>: my code is</p>
  
  <pre><code>&lt;?php
      ini_set('memory_set',-1);
      $connect = sasql_connect("UID=username;PWD=pass");
      echo "Connection succeed";
  
      $result = sasql_query($connect, "SELECT * FROM table1, table2");
  
      if(!$result){
      echo "sasql_query failed";
      return 0;
      } else {
      echo "query completed successfully\n";
      sasql_result_all($result);
      }
      sasql_close($conn);
  ?&gt;
  </code></pre>
  
  <p>I hope someone can help me.</p>
  
  <p><strong>SOLUTION</strong>:
  I've found the solution: I've added a <code>WHERE (columnName1 = columnName2)</code>, split the result and it works again, relative fast!</p>
  
  <pre><code>&lt;?php
      $connect = sasql_connect("UID=username;PWD=pass");
      if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };
      $results_page = 100;
      $start_from = ($page-1) * $results_page + 1;    
      $result = sasql_query($connect, "SELECT TOP $results_page START AT $start  * 
                      FROM table1, table2 WHERE (columnName1 = columnName2)");
  
      if(!$result){
      echo "sasql_query failed";
      return 0;
      } else {
      echo "query completed successfully\n";
      sasql_result_all($result);
      }
      sasql_close($conn);
  ?&gt;
  </code></pre>
  
  <p>Ofcourse I add in my <code>php-page</code> a <code>&lt;a href="&lt;?php echo $page -1; ?&gt;"&gt;Previous&lt;/a&gt;</code> and a <code>&lt;a href="&lt;?php echo $page + 1; ?&gt;"&gt;Next&lt;/a&gt;</code></p>
  
  <p>Thanks to you all for the help!</p>