English 中文(简体)
为什么 PHP 脚本无法更新 Oracle 数据库中的数据?
原标题:Why PHP script is not being able to update data in oracle database?

以下代码不是将记录更新到甲骨文数据库, 任何人都能帮助解释原因吗? 如果有任何其他原因引起问题, 请建议。 提前感谢 。

<?php
if(isset($_GET[ submit ])) {
echo $sl_no = $_GET[ sl_no ];
echo $subject = $_GET[ subject ];


// update Subject
$str2 = "update application_form af set af.subject_code=:subject where   af.application_form_sl_no=:sl_no";
$stid_update2 = oci_parse($conn, $str2);
oci_bind_by_name($stid_update2, ":subject", $subject);
oci_bind_by_name($stid_update2, ":sl_no", $sl_no);
oci_execute($stid_update2);
$success2 = oci_commit($conn);

// send successful message

    if($success2)
    {
    echo "Form saved Successfully!!!";
    }
}   
?>
问题回答

您没有声明$conn 变量并连接到数据库

$conn = oci_connect( hr ,  welcome ,  localhost/XE );

资源来源:http://php.net/manual/en/formation.oci-connect.php





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签