I'm making queries from PHP to an Oracle database.
The problem is that when the database has few records (5 for example), when I go through the oci_fetch_array function, it returns them without problem, but when it is 100 records it returns me null .
This is the code:
$sql = oci_parse($this->db, "SELECT * FROM EMPRESAS ORDER BY ID DESC");
oci_execute($sql);
$array = [];
while ($row = oci_fetch_array($sql, OCI_ASSOC + OCI_RETURN_NULLS)) {
array_push($array, $row);
}
return $array ? $array : null;
It returns null because the array is empty.
Any idea what may be happening?
I have done debug and it does not enter the loop. $ row returns false.
I'm using Oracle database 11g Express and PHP 5.6.
I have also tried the oci_error () function and it returns false.
I do the same select from SQL Developer and it correctly returns all the rows.