Skip to content
Advertisement

Errors when trying to push to OCI db

Trying to post to OCI db based on data from an error log.

Get the ORA-24374 error when trying to execute.

“Warning: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in C:xampphtdocswamheader.php on line 46”;

Ironically, it does post data to the db. However I still get the error. And need to refresh the .php page to get result of the rest of the code to execute.

Code in question:

from header.php

From error_log.php:

From api.php:

This OCI instance has worked fine for many different db operations.

I have taken this project over from another developer and I am new to php/OCI. So I am reticent to change anything to the dbQuerySafe function from header.php as it is used successfully throughout the project.

Any advice welcome.

Advertisement

Answer

So the issue had been not correctly configuring the function to have an array with the values mapped.

tl:dr; this is the code I needed to change in api.php:

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