Php Oracle插入查询不起作用&;也不会抛出任何错误
嗨,我是甲骨文的新手 我试图在PHP中使用oracle将记录插入表中。 但它不工作,也没有抛出任何错误 下面是我的代码。 请告诉我哪里做错了Php Oracle插入查询不起作用&;也不会抛出任何错误,php,oracle,yii,Php,Oracle,Yii,嗨,我是甲骨文的新手 我试图在PHP中使用oracle将记录插入表中。 但它不工作,也没有抛出任何错误 下面是我的代码。 请告诉我哪里做错了 $insertSQL= "INSERT INTO GL_USR_MAIL_FOLDER(FK_GLUSR_USR_ID, GL_USR_MAIL_FOLDER_NAME) VALUES (:USERDET,:FOLDERNAME) RETURNING GL_USR_MAIL_FOLDER_ID INTO :FOLDER_ID"; try{ // ec
$insertSQL= "INSERT INTO GL_USR_MAIL_FOLDER(FK_GLUSR_USR_ID, GL_USR_MAIL_FOLDER_NAME) VALUES (:USERDET,:FOLDERNAME) RETURNING GL_USR_MAIL_FOLDER_ID INTO :FOLDER_ID";
try{
// echo "try 111LL:L";
$stid = oci_parse($dbh, $insertSQL);
$e = oci_error($stid); // For oci_execute errors pass the statement handle
print htmlentities($e['message']);
}catch (Exception $ex) {
GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Parsing of Query couldn't take place ","Parsing of Query couldn't take place for Query : \n $sql", $ex,0);
}
try{
//echo "try bindd";
oci_bind_by_name($stid, ":USERDET", $postData['glusrid']);
oci_bind_by_name($stid, ":FOLDERNAME", $postData['foldername']);
oci_bind_by_name($stid, ":FOLDER_ID", $folderid, 8, OCI_B_INT);
$e = oci_error($stid); // For oci_execute errors pass the statement handle
print htmlentities($e['message']);
} catch (Exception $ex) {
GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Binding of Query couldn't take place ","Binding of Query couldn't take place for Query : \n $sql", $ex,0);
}
try{
$s = oci_execute($stid);
if(!$s){
$e = oci_error($stid);
print htmlentities($e['message']);
}
print_r($s);echo "after execute";
oci_commit($dbh);
}catch(Exception $ex){
GlobalFunc::print_oracle_error(__CLASS__, __FILE__, __LINE__, "Execution of Query couldn't take place ","Execution of Query couldn't take place for Query : \n $sql", $ex,0);
}
您正在使用Yii框架吗?在这种情况下,您是否尝试将ActiveRecord与Php PDO一起使用,而不是直接数据库访问(oci_……)?您是否使用Yii框架?在这种情况下,您是否尝试将ActiveRecord与Php PDO一起使用,而不是直接数据库访问(oci_……)?