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.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料