Skip to content
Advertisement

Get connection handle details of Oracle resource handle in PHP for debugging validity of connection

Scenario

I use a function, namely oci_connect, to connect to an Oracle database. Outputting oci_num_rows($handle) displays 0, which does not correspond to another page output that displays a value above 0 which I observe on the same query but possibly different connection information.

Problem

I want to output the details of this resource for inspecting why my query (which has been checked for spelling and parameter matching successfully and query parameters present) is returning 0 rows.

I tried echo($conn) but it returns

resource(8, oci8 connection)

to the browser.

Question

How do I output the connection specific details of the resource handle using PHP?

Advertisement

Answer

So far I have been able to var_dump(get_defined_vars()) and it displays all values of all variable values.

I have been unable to find the line there the variables are set at runtime, at least the most recent line, at runtime.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement