duangang4001 2013-04-12 23:27
浏览 63
已采纳

PHP脚本停止在oci_execute

I have a script with the following code to insert data into an Oracle table:

$sql = "INSERT INTO EXAMPLE_TABLE (ID, FIELD, VAL) VALUES (:id, :test, :ok)"; 

$stid = oci_parse($conn, $sql);
//die("parsed ok");

oci_bind_by_name($stid, ":id", $id);
oci_bind_by_name($stid, ":test", $test);
oci_bind_by_name($stid, ":ok", $ok);

//die("params bound");

$result =@oci_execute($stid);

if(!$result)
{               
   $err = oci_error($stid);
   $error = $err['message']; 
   echo $error; die('end error');
}

echo oci_num_rows($stid) . " rows inserted.<br />";
die("inserted");

The script was working fine, and then it just stopped. I threw in some die statements to find where the script is stalling. The last place I can get to is "die("params bound")".

I've verified that the variables are ok and that the database connection is valid. I also manually connected to the database using sqldeveloper and had no problem.

Why is this script suddenly stalling?

  • 写回答

1条回答 默认 最新

  • dpg98445 2013-04-12 23:33
    关注

    As often happens, I had a though immediately after I posted this question. I checked to see how many connections I had open in a GUI, and then closed the connections.

    It turns out that I had some uncommitted changes from some queries that I ran manually in my GUI, and I think that was stalling the script at oci_execute. After rolling back the changes and restarting my connection, the script works fine now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置