N
N
Noffily2015-02-09 13:08:24
PHP
Noffily, 2015-02-09 13:08:24

No Oracle DB fetch results in PHP, why?

For some reason, the function does not work oci_fetch ();when a query is executed in Oracle SQL Developer, the data is returned, but not in PHP.
Code example:

$username = 'user';
$password = 'pass';
$db = 'db';

$connect = OCILogon($username, $password, $db, 'AL32UTF8'); 

$select = "
select row
from scheme.table
";

$query = OCI_Parse($connect, $select);

// Возвращает  true 
oci_define_by_name($query, 'ROW', $row);

// Возвращает  true 
oci_execute($query);

// Возвращает false 
while (oci_fetch($query)) {
    echo $row;
}

oci_free_statement($query);
oci_close($connect);

Moreover, other requests work and return something, but this one does not.
The table has 100% data.
Why can this happen?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2015-02-09
@SilenceOfWinter

If you do not understand the problem, then try using PDO.

V
Vapaamies, 2015-02-09
@vapaamies

Is it really a table and not a view? Is there some kind of feature in the database, like row-by-line access control or DBMS_RULE? Isn't the table in question a kind of global temporary table ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question