php oracle update oci_execute,如何使用ORACLE(OCI)在SQL / PHP中執行更新查詢

I'm new to Oracle and using OCI with PHP. I've been doing ok until I've tried to do an update statement.

我是Oracle的新手,並且使用OCI和PHP。在我嘗試做更新聲明之前,我一直沒事。

include("ORCLconfig.php");

$updateTitleInserted = oci_parse($conn, "UPDATE insured SET INSURED_TITLE=

'$updateTitle' WHERE INSURED_ID='$INSURED_ID'");

oci_execute($updateTitleInserted, OCI_COMMIT_ON_SUCCESS);

oci_free_statement($updateTitleInserted);

oci_close($conn);

All I'm trying to do is and update statement so the user can change the Title of a person. I am using AJAX to do this asynchronously and when the user attempts to change the title to the current value it processes the function fine but if the new value is different it gets stuck at the update statement and no change is made.

我所要做的就是更新語句,以便用戶可以更改一個人的標題。我正在使用AJAX異步執行此操作,當用戶嘗試將標題更改為當前值時,它會正常處理函數,但如果新值不同,則會卡在update語句中並且不會進行任何更改。

1 个解决方案

#1

4

$c = oci_connect($userName, $password, "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =$serverName)(PORT = 1521)))(CONNECT_DATA=(SID=$databaseName)))");

$strQuery = "UPDATE table SET field = :xx WHERE ID = 123"

$stmt = OCIParse($c, $strQuery);

OCIBindByName($stmt, ':xx', $fieldval);

$ok = OCIExecute($stmt);

try this

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值