php function odbc_fetch_obect

0

I have a problem using the odbc_fetch_object function, when executing my query it shows me the error

  

PHP Fatal error: Allowed memory size of 546308096 bytes exhausted   (tried to allocate 4294967320 bytes) in   C: \ inetpub \ wwwroot \ ajax \ test.php on line 8

just in the line that function is used, I have already tried increasing the memory limit in the php.ini to 8gb but the only thing I achieve is to stop the FastCGI process, I have tried to use different functions but only those that are odb_fetch are those that present that problem, then the others respond normally to the query but just the function odbc_fetch_object are the ones that we need to use and there are too many to replace them or do a database migration

<?php 

$con = odbc_connect('DSN-name', 'user', 'pass');

$result = odbc_exec($con, "select * from nameTabla");

//no funciona
while($rows = odbc_fetch_object($result)){
    exit($rows);
    echo $rows->nombre.'<br>';
}

//tampoco funciona
$rows = odbc_fetch_object($result, "border=1");

//este si funciona
odbc_result_all($result, "border=1");

//funciona
$result= odbc_exec($con, "select * from nameTabla") or die (exit("Error en odbc_exec"));
print odbc_result_all($result, "border=1");


 ?>

Pd: We have tested using version 5.6 to 7.2.7, but only 5.4, which is what we currently have in production, is the only one that does not present this type of inconvenience, but we need to update our PHP at the request of our clients. .

Pd2: this is all working with a 64-bit architecture (we tested the connection and it works perfectly, only those functions are the ones that present us with a problem).

    
asked by RMC 05.07.2018 в 22:14
source

0 answers