duanputian5341 2012-11-03 13:43
浏览 338

PHP错误:警告:ociparse()参数1是资源

As there is not ready made function in oracle to validate the Query so created. So I tried below code to check whether the 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 got following Warnings in the 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?

  • 写回答

1条回答 默认 最新

  • duanneng2014 2012-11-03 13:56
    关注

    You must first connect to the database. This connection must a "resource" to variable $DB.

    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)