Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP fatal error - out of memory - tried to allocate 4294967293 bytes
    primarykey
    data
    text
    <p>I have a PHP function that is getting data from an SQL DB. Sometimes I get this fatal error while doing odbc_result</p> <ul> <li>Step 30 from 60 | Memory 191908 </li> <li>Step 31 from 60 | Memory 191908 </li> <li>Step 32 from 60 | Memory 191908 </li> <li>Step 33 from 60 | Memory 191908 </li> <li>Step 34 from 60 | Memory 191892 </li> <li>Step 35 from 60 | Memory 191908 </li> <li>Step 36 from 60 | Memory 191908 </li> <li>Step 37 from 60 | Memory 191892 </li> <li>Step 38 from 60 | Memory 191908 </li> <li>Step 39 from 60 | Memory 191908 </li> <li>PHP Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967293 bytes)</li> </ul> <p>This is a piece of my output from the function.</p> <p>Can someone please help me with this problem?</p> <pre><code> while(odbc_fetch_row($exec_query_tblKlantFactuurOpdrachten)) { $dataADDRow_1 = $doc-&gt;createElement("tblKlantFactuurOpdrachten"); $dataADDRow-&gt;appendChild($dataADDRow_1); $i_1 = 1; while($i_1 &lt; $numFields_1) { echo "Step ".$i_1." from ".$numFields_1." | Memory ".memory_get_usage()."\n"; $dataFromDB = odbc_result($exec_query_tblKlantFactuurOpdrachten,$i_1); $dataADD = $doc-&gt;createElement($tmpArr_FieldName_1[$i_1],protectInfo($dataFromDB)); $dataADDRow_1-&gt;appendChild($dataADD); flush(); ++$i_1; } flush(); } </code></pre> <p>I've retried to get the data from the DB with a simple query and when i try to get the same exact field I get that error also. So it seems that is something with the relationship between DB and PHP. I am using freetds driver on linux server.</p> <p>When I get the data with SQL Server Management there is no problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload