PHP error: warning: ociparse () 1 parameter is a resource

Since the oracle does not have a ready-made function for checking the created request. So I tried under the code to check if QUERY is valid or not.

if(isset($_POST['btn_Submit_Query'])) { $check_query=$_POST['txtQuery']; echo $check_query; $valid = false; $stmt = oci_parse($DB, $check_query); echo "Statement" . $stmt; //oci_define_by_name($stmt, 'NUMBER_OF_ROWS', $number_of_rows); oci_execute($stmt, OCI_DEFAULT); echo oci_num_rows($stmt); } 

I received the following warnings in execution:

 Warning: oci_parse() expects parameter 1 to be resource, object given in D:\xampp\htdocs\app\DashBoardSite\Admin\querybuilder.php on line 899 Statement Warning: oci_execute() expects parameter 1 to be resource, null given in D:\xampp\htdocs\app\DashBoardSite\Admin\querybuilder.php on line 902 Warning: oci_num_rows() expects parameter 1 to be resource, null given in D:\xampp\htdocs\app\DashBoardSite\Admin\querybuilder.php on line 903 

Where is my mistake?

+4
source share
1 answer

You must first connect to the database. This connection should be the "resource" for the $ DB variable.

+1
source

Source: https://habr.com/ru/post/1443823/


All Articles