在oracle中没有响应更新查询

在oracle中没有响应更新查询

本文介绍了在oracle中没有响应更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是初学者。我创建了一个php html组合页面(viewemployees.php)来从oracle数据库中显示我的表。它运行良好。然后我创建了一个页面来编辑我的数据库表(editemployees.php)。该页面有两个功能。它显示原始表和一个简单表单,其中应包含更新表的元素。当我们在表单中放置值时,它会将我们引导到一个新的php页面(een.php),它将更新表并返回到显示更新表的editemployees.php。但是当我填写表格并且没有发生时,我被困住了。即使我已经放置了一个条件,如果新值字段为空,则会回显一行。仍然没有回应那条线。这有些奇怪。我发布了我的编辑和查看页面代码点击链接。善意的帮助。
简单的我的表更新不起作用,并在een.php的第4行显示未定义的变量错误。为什么taht variabl undefined?任何人都可以提供帮助





 < ;?phpinclude(connection.php); $ empid = $ _POST ['EMPLOYEE ID']; $ field = $ _POST ['EDIT FIELD']; $ nfield = $ _POST ['NEW VALUE']; echo $ field ; if(空($ _ POST ['NEW VALUE'])){echo正确输入新字段; } else {$ e = filter_var($ empid,FILTER_SANITIZE_EMAIL); $ f = filter_var($ field,FILTER_SANITIZE_EMAIL); $ nf = filter_var($ nfield,FILTER_SANITIZE_EMAIL);} if($ e == $ empid&& $ f == $ field& $ amp; $ nf == $ nfield){if($ field ==age|| $ field ==sal){$ sel =seleect * from employ; $ st = oci_parse($ conn,$ sel); oci_execute($ st); $ query =update employ set $ field = $ nfield where empid = $ empid; $ stmt = oci_parse($ conn,$ query); oci_execute($ stmt, OCI_COMMIT_ON_SUCCESS); oci_free_statement($ updateTitleInserted); oci_close($ conn); echo oci_error(); header(Location:home.html);} else {$ query =update employ set $ field ='$ nfield'where empid = $ empid; $ stmt = oci_parse ($康恩,$查询); oci_execute($语句,OCI_COMMIT_ON_SUCCESS); oci_free_statement($ updateTitleInserted); oci_close($ conn); echo oci_error(); echo $ field;}} else echowrong data entry go back and enter again;?>  


解决方案

这一行没有意义。

  $ empid = $ _POST [EMPLOYER ID]; 

后期变量名称不能包含空格。

I am a beginner . I made a php html combined page(viewemployees.php) to display my table from oracle data base. It worked fine. Then i made a page to edit my data base table(editemployees.php). that page has two functions. It displays the original table and a simple form which should contain the elements to update the table. When we place values in the form it directs us to a new php page(een.php) where it updates table and returns back to editemployees.php showing the updated table. but i am stuck when i fill in the form AND NOTHING happens. Even I have placed a condition that to echo a line if new value field is null. still that line is not echoed. This is some weird thing. I am posting both of my edit and view pages code click the link. kindly help. In simple my table update is not working and showing undefined variable error at line 4 of een.php. Why is taht variabl undefined?? can anyone help please

https://www.dropbox.com/sh/xtuvotdy7c9wr1v/AADrNSlC_EJ0YkyDDkhe8mKGa?dl=0

<?php

include("connection.php");
$empid = $_POST['EMPLOYEE ID'];
$field = $_POST['EDIT FIELD'];
$nfield     = $_POST['NEW VALUE'];

echo $field;
if( empty($_POST['NEW VALUE'] )){
echo "type new field properly";
 }
else
{
$e = filter_var($empid, FILTER_SANITIZE_EMAIL);
$f = filter_var($field, FILTER_SANITIZE_EMAIL);
$nf = filter_var($nfield, FILTER_SANITIZE_EMAIL);
}

if( $e==$empid && $f==$field && $nf==$nfield)
{
if ($field=="age" || $field=="sal"){
$sel = "seleect * from employ";
$st = oci_parse(conn, $sel);
oci_execute($st);
$query = " update employ  set $field = $nfield where empid = $empid";
$stmt = oci_parse($conn,$query);
oci_execute($stmt, OCI_COMMIT_ON_SUCCESS);
oci_free_statement($updateTitleInserted);
oci_close($conn);
echo oci_error();
header("Location: home.html");
}

else{

$query = "update employ set $field = '$nfield' where empid = $empid";
$stmt = oci_parse($conn,$query);
oci_execute($stmt,OCI_COMMIT_ON_SUCCESS);
oci_free_statement($updateTitleInserted);
oci_close($conn);
echo oci_error();
echo $field;

}
}


else
echo "wrong data entry go back and enter again";

?>

解决方案

This line does not make sense.

$empid = $_POST["EMPLOYER ID"];

A post variable name cannot contain a space.

这篇关于在oracle中没有响应更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 08:03