title: Fatal error: Out of memory (allocated 524288) (tried to allocate 4294967293 bytes)
body: <p>The setup</p>
  
  <p>Server : Win7<br>
  Database: MSSQLServer 2012<br>
  WebServer : IIS<br>
  PHP : 5.5<br>
  Connection : <code>$driver="Driver={SQL Server Native Client 11.0}</code></p>
  
  <pre><code>SELECT auditid, Datalength(comments)
  FROM tblAudit
  ORDER BY 2 desc
  
  278 33152 (Equates to 16576 characters when viewing in Notepad++)
  239 22308 (Equates to 11186 characters when viewed in Notepad++)
  
  php memory settings
  ini_set("memory_limit", "-1");
  </code></pre>
  
  <p>php</p>
  
  <pre><code>$Comments = odbc_result($rsAudit,"Comments");
  </code></pre>
  
  <p>Works fine for 22308 string length</p>
  
  <p>With 33152 </p>
  
  <pre><code>Fatal error: Out of memory (allocated 524288) (tried to allocate 4294967293 bytes) in D:\Inetpub\wwwroot\TramsWeb\php\auditsummary.php on line 235
  </code></pre>
  
  <p>16,576 does not seem like a lot of characters to select in one go, but it is crashing php.</p>
  
  <p>Can anyone advise on a solution to this problem?</p>