Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 错误:oci_bind_by_name()需要参数1_Php_Oracle - Fatal编程技术网

Php 错误:oci_bind_by_name()需要参数1

Php 错误:oci_bind_by_name()需要参数1,php,oracle,Php,Oracle,我在这个代码部分得到了以下错误消息,我无法解释它。也许你有给我的小费 PHP警告:oci_bind_by_name()希望参数1是resource,在第190行的/var2/www/dk/testing/pulsk/mods/mod_newIdea/page_submitIdea.PHP中给出空值,参考号:https: 您应该使用var_dump($stid)来查看是否为null。您需要添加错误检查。您不能假设oci\u parse(),或大多数其他数据库函数不可能失败。 $ideSta

我在这个代码部分得到了以下错误消息,我无法解释它。也许你有给我的小费

PHP警告:oci_bind_by_name()希望参数1是resource,在第190行的/var2/www/dk/testing/pulsk/mods/mod_newIdea/page_submitIdea.PHP中给出空值,参考号:https:


您应该使用var_dump($stid)来查看是否为null。您需要添加错误检查。您不能假设
oci\u parse()
,或大多数其他数据库函数不可能失败。
    $ideStart = time();
            $counter = 0;
            $status = "new";

            $stid = oci_parse($conn, "INSERT INTO IDM_HISTORY (HIS_UNIX_TIME_START, HIS_PERSNUM, HIS_STATUS, HIS_HASH) VALUES (:HIS_UNIX_TIME_START, :HIS_PERSNUM, :HIS_STATUS, :HIS_HASH)");
            oci_bind_by_name($stid, ':HIS_UNIX_TIME_START', $ideStart);
            oci_bind_by_name($stid, ':HIS_PERSNUM', $_SESSION['ac_persnr']);
            oci_bind_by_name($stid, ':HIS_STATUS', $status);
            oci_bind_by_name($stid, ':HIS_HASH', $_SESSION['hash']);

            oci_execute($stid);
            oci_free_statement($stid);