Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
注意:第28行的D:\wamp\www\LTID\updaterbet.php中的未定义索引:ID_Php_Pdo - Fatal编程技术网

注意:第28行的D:\wamp\www\LTID\updaterbet.php中的未定义索引:ID

注意:第28行的D:\wamp\www\LTID\updaterbet.php中的未定义索引:ID,php,pdo,Php,Pdo,我这里有更新记录的代码问题是,当我尝试更新记录并点击提交按钮时,它总是显示一个未定义索引的错误。。 我希望有人能帮我解决这个问题,我正在努力解决这个问题 以下是错误: 注意:未定义的索引:D:\wamp\www\LTID\updaterbet.php中的ID 第28行 注意:未定义索引:省中 D:\wamp\www\LTID\updaterbet.php,第31行 注意:未定义索引: 第39行D:\wamp\www\LTID\updaterbet.php中的RLBET\u操作 注意: 未定义索引

我这里有更新记录的代码问题是,当我尝试更新记录并点击提交按钮时,它总是显示一个未定义索引的错误。。 我希望有人能帮我解决这个问题,我正在努力解决这个问题

以下是错误:

注意:未定义的索引:D:\wamp\www\LTID\updaterbet.php中的ID 第28行
注意:未定义索引:省中 D:\wamp\www\LTID\updaterbet.php,第31行
注意:未定义索引: 第39行D:\wamp\www\LTID\updaterbet.php中的RLBET\u操作 注意: 未定义索引:月日在D:\wamp\www\LTID\updaterbet.php中批准 第41行 注意:未定义索引:年\年批准 D:\wamp\www\LTID\updaterbet.php,第42行
注意:未定义索引: 第45行D:\wamp\www\LTID\updaterbet.php中的原因摘要 SQLSTATE[HY093]:参数编号无效:未定义参数

下面是class.user.php

public function update($ID,$LHID,$LO_Name,$Province,$Municipality,$Barangay,$Title_Number,$Lot_Number,$Survey_Number,$Area,$Resolution_Number,$RLBET_Action,$Resolution_Date,$Month_Approved,$Year_Approved,$PARCCOM_Number,$PARCCOM_Date,$Summary_of_Reason,$Reason_for_Deduction,$Date_Inserted)
  {
    try
    {

    $stmt=$this->db->prepare("UPDATE rlbet SET LHID = :LHID,LO_Name=:LO_Name,Province=:Province, Municipality = :Municipality, Barangay = :Barangay, Title_Number = :Title_Number, Lot_Number = :Lot_Number, Survey_Number = :Survey_Number, Area = :Area, Resolution_Number = :Resolution_Number, Resolution_Date = :Resolution_Date, Month_Approved = :Month_Approved, Year_Approved = :Year_Approved, PARCCOM_Number = :PARCCOM_Number, PARCCOM_Date = :PARCCOM_Date, Summary_of_Reason = :Summary_of_Reason, Reason_for_Deduction = :Reason_for_Deduction, Date_Inserted = NOW() WHERE ID = :ID");

    $stmt->bindparam(":LHID",$LHID);
    $stmt->bindparam(":LO_Name",$LO_Name);
    $stmt->bindparam(":Province",$Province);
    $stmt->bindparam(":Municipality",$Municipality);
    $stmt->bindparam(":Barangay",$Barangay);
    $stmt->bindparam(":Title_Number",$Title_Number);
    $stmt->bindparam(":Lot_Number",$Lot_Number);
    $stmt->bindparam(":Survey_Number",$Survey_Number);
    $stmt->bindparam(":Area",$Area);
    $stmt->bindparam(":Resolution_Number",$Resolution_Number);
    $stmt->bindparam(":RLBET_Action",$RLBET_Action);
    $stmt->bindparam(":Resolution_Date",$Resolution_Date);
    $stmt->bindparam(":Month_Approved",$Month_Approved);
    $stmt->bindparam(":Year_Approved",$Year_Approved);
    $stmt->bindparam(":PARCCOM_Number",$PARCCOM_Number);
    $stmt->bindparam(":PARCCOM_Date",$PARCCOM_Date);
    $stmt->bindparam(":Summary_of_Reason",$Summary_of_Reason);
    $stmt->bindparam(":Reason_for_Deduction",$Reason_for_Deduction);
    $stmt->bindparam(":ID",$ID);
    $stmt->execute();

      return true;
    }
    catch(PDOException $e)
    {
      echo $e->getMessage();
      return false;
    }
  }
<?php
include_once 'db.php';

$LHID = isset($_GET['LHID']) ? $_GET['LHID'] : '';
$LO_Name = isset($_GET['LO_Name']) ? $_GET['LO_Name'] : '';
$Province = isset($_GET['Province']) ? $_GET['Province'] : '';
$Municipality = isset($_GET['Municipality']) ? $_GET['Municipality'] : '';
$Barangay = isset($_GET['Barangay']) ? $_GET['Barangay'] : '';
$Title_Number = isset($_GET['Title_Number']) ? $_GET['Title_Number'] : '';
$Lot_Number = isset($_GET['Lot_Number']) ? $_GET['Lot_Number'] : '';
$Survey_Number = isset($_GET['Survey_Number']) ? $_GET['Survey_Number'] : '';
$Area = isset($_GET['Area']) ? $_GET['Area'] : '';
$Resolution_Number = isset($_GET['Resolution_Number']) ? $_GET['Resolution_Number'] : '';
$RLBET_Action = isset($_GET['RLBET_Action']) ? $_GET['RLBET_Action'] : '';
$Resolution_Date = isset($_GET['Resolution_Date']) ? $_GET['Resolution_Date'] : '';
$Month_Approved = isset($_GET['Month_Approved']) ? $_GET['Month_Approved'] : '';
$Year_Approved = isset($_GET['Year_Approved']) ? $_GET['Year_Approved'] : '';
$PARCCOM_Number = isset($_GET['PARCCOM_Number']) ? $_GET['PARCCOM_Number'] : '';
$PARCCOM_Date = isset($_GET['PARCCOM_Date']) ? $_GET['PARCCOM_Date'] : '';
$Summary_of_Reason = isset($_GET['Summary_of_Reason']) ? $_GET['Summary_of_Reason'] : '';
$Reason_for_Deduction = isset($_GET['Reason_for_Deduction']) ? $_GET['Reason_for_Deduction'] : '';
$Date_Inserted = isset($_GET['Date_Inserted']) ? $_GET['Date_Inserted'] : '';

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$ID = $_GET['ID'];
$LHID = $_POST['LHID'];
$LO_Name = $_POST['LO_Name'];
$Province = $_POST['Province'];
$Municipality = $_POST['Municipality'];
$Barangay = $_POST['Barangay'];
$Title_Number = $_POST['Title_Number'];
$Lot_Number = $_POST['Lot_Number'];
$Survey_Number = $_POST['Survey_Number'];
$Area = $_POST['Area'];
$Resolution_Number = $_POST['Resolution_Number'];
$RLBET_Action = $_POST['RLBET_Action'];
$Resolution_Date = $_POST['Resolution_Date'];
$Month_Approved = $_POST['Month_Approved'];
$Year_Approved = $_POST['Year_Approved'];
$PARCCOM_Number = $_POST['PARCCOM_Number'];
$PARCCOM_Date = $_POST['PARCCOM_Date'];
$Summary_of_Reason = $_POST['Summary_of_Reason'];
$Reason_for_Deduction = $_POST['Reason_for_Deduction'];
$Date_Inserted = $_POST['Date_Inserted'];

if($LTID->update($ID, $LHID, $LO_Name, $Province, $Municipality, $Barangay, $Title_Number, $Lot_Number, $Survey_Number, $Area, $Resolution_Number, $RLBET_Action, $Resolution_Date, $Month_Approved, $Year_Approved, $PARCCOM_Number, $PARCCOM_Date, $Summary_of_Reason, $Reason_for_Deduction, $Date_Inserted))
{

    echo "<script type='text/javascript'>alert('Successfully Updated!');</script>";
}
else
{
    echo "<script type='text/javascript'>alert('Updating Failed!'); </script>";
}
}

if(isset($_GET['ID']))
{
$ID = $_GET['ID'];
extract($LTID->getID($ID));
}
?>
updaterbet.php

public function update($ID,$LHID,$LO_Name,$Province,$Municipality,$Barangay,$Title_Number,$Lot_Number,$Survey_Number,$Area,$Resolution_Number,$RLBET_Action,$Resolution_Date,$Month_Approved,$Year_Approved,$PARCCOM_Number,$PARCCOM_Date,$Summary_of_Reason,$Reason_for_Deduction,$Date_Inserted)
  {
    try
    {

    $stmt=$this->db->prepare("UPDATE rlbet SET LHID = :LHID,LO_Name=:LO_Name,Province=:Province, Municipality = :Municipality, Barangay = :Barangay, Title_Number = :Title_Number, Lot_Number = :Lot_Number, Survey_Number = :Survey_Number, Area = :Area, Resolution_Number = :Resolution_Number, Resolution_Date = :Resolution_Date, Month_Approved = :Month_Approved, Year_Approved = :Year_Approved, PARCCOM_Number = :PARCCOM_Number, PARCCOM_Date = :PARCCOM_Date, Summary_of_Reason = :Summary_of_Reason, Reason_for_Deduction = :Reason_for_Deduction, Date_Inserted = NOW() WHERE ID = :ID");

    $stmt->bindparam(":LHID",$LHID);
    $stmt->bindparam(":LO_Name",$LO_Name);
    $stmt->bindparam(":Province",$Province);
    $stmt->bindparam(":Municipality",$Municipality);
    $stmt->bindparam(":Barangay",$Barangay);
    $stmt->bindparam(":Title_Number",$Title_Number);
    $stmt->bindparam(":Lot_Number",$Lot_Number);
    $stmt->bindparam(":Survey_Number",$Survey_Number);
    $stmt->bindparam(":Area",$Area);
    $stmt->bindparam(":Resolution_Number",$Resolution_Number);
    $stmt->bindparam(":RLBET_Action",$RLBET_Action);
    $stmt->bindparam(":Resolution_Date",$Resolution_Date);
    $stmt->bindparam(":Month_Approved",$Month_Approved);
    $stmt->bindparam(":Year_Approved",$Year_Approved);
    $stmt->bindparam(":PARCCOM_Number",$PARCCOM_Number);
    $stmt->bindparam(":PARCCOM_Date",$PARCCOM_Date);
    $stmt->bindparam(":Summary_of_Reason",$Summary_of_Reason);
    $stmt->bindparam(":Reason_for_Deduction",$Reason_for_Deduction);
    $stmt->bindparam(":ID",$ID);
    $stmt->execute();

      return true;
    }
    catch(PDOException $e)
    {
      echo $e->getMessage();
      return false;
    }
  }
<?php
include_once 'db.php';

$LHID = isset($_GET['LHID']) ? $_GET['LHID'] : '';
$LO_Name = isset($_GET['LO_Name']) ? $_GET['LO_Name'] : '';
$Province = isset($_GET['Province']) ? $_GET['Province'] : '';
$Municipality = isset($_GET['Municipality']) ? $_GET['Municipality'] : '';
$Barangay = isset($_GET['Barangay']) ? $_GET['Barangay'] : '';
$Title_Number = isset($_GET['Title_Number']) ? $_GET['Title_Number'] : '';
$Lot_Number = isset($_GET['Lot_Number']) ? $_GET['Lot_Number'] : '';
$Survey_Number = isset($_GET['Survey_Number']) ? $_GET['Survey_Number'] : '';
$Area = isset($_GET['Area']) ? $_GET['Area'] : '';
$Resolution_Number = isset($_GET['Resolution_Number']) ? $_GET['Resolution_Number'] : '';
$RLBET_Action = isset($_GET['RLBET_Action']) ? $_GET['RLBET_Action'] : '';
$Resolution_Date = isset($_GET['Resolution_Date']) ? $_GET['Resolution_Date'] : '';
$Month_Approved = isset($_GET['Month_Approved']) ? $_GET['Month_Approved'] : '';
$Year_Approved = isset($_GET['Year_Approved']) ? $_GET['Year_Approved'] : '';
$PARCCOM_Number = isset($_GET['PARCCOM_Number']) ? $_GET['PARCCOM_Number'] : '';
$PARCCOM_Date = isset($_GET['PARCCOM_Date']) ? $_GET['PARCCOM_Date'] : '';
$Summary_of_Reason = isset($_GET['Summary_of_Reason']) ? $_GET['Summary_of_Reason'] : '';
$Reason_for_Deduction = isset($_GET['Reason_for_Deduction']) ? $_GET['Reason_for_Deduction'] : '';
$Date_Inserted = isset($_GET['Date_Inserted']) ? $_GET['Date_Inserted'] : '';

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$ID = $_GET['ID'];
$LHID = $_POST['LHID'];
$LO_Name = $_POST['LO_Name'];
$Province = $_POST['Province'];
$Municipality = $_POST['Municipality'];
$Barangay = $_POST['Barangay'];
$Title_Number = $_POST['Title_Number'];
$Lot_Number = $_POST['Lot_Number'];
$Survey_Number = $_POST['Survey_Number'];
$Area = $_POST['Area'];
$Resolution_Number = $_POST['Resolution_Number'];
$RLBET_Action = $_POST['RLBET_Action'];
$Resolution_Date = $_POST['Resolution_Date'];
$Month_Approved = $_POST['Month_Approved'];
$Year_Approved = $_POST['Year_Approved'];
$PARCCOM_Number = $_POST['PARCCOM_Number'];
$PARCCOM_Date = $_POST['PARCCOM_Date'];
$Summary_of_Reason = $_POST['Summary_of_Reason'];
$Reason_for_Deduction = $_POST['Reason_for_Deduction'];
$Date_Inserted = $_POST['Date_Inserted'];

if($LTID->update($ID, $LHID, $LO_Name, $Province, $Municipality, $Barangay, $Title_Number, $Lot_Number, $Survey_Number, $Area, $Resolution_Number, $RLBET_Action, $Resolution_Date, $Month_Approved, $Year_Approved, $PARCCOM_Number, $PARCCOM_Date, $Summary_of_Reason, $Reason_for_Deduction, $Date_Inserted))
{

    echo "<script type='text/javascript'>alert('Successfully Updated!');</script>";
}
else
{
    echo "<script type='text/javascript'>alert('Updating Failed!'); </script>";
}
}

if(isset($_GET['ID']))
{
$ID = $_GET['ID'];
extract($LTID->getID($ID));
}
?>

我不确定您是否在使用
$\u GET
$\u POST
作为
ID

尝试检查您的所有参数,无论是否设置

$ID = isset($_GET['ID']) ? $_GET['ID'] : 0 ;
$Province = isset($_POST['Province']) ? $_POST['Province'] : '';
这将帮助您摆脱
未定义索引
通知

对于
SQLSTATE
错误,您绑定了
:RLBET\u操作
,并且在准备语句时忘记添加


希望这将有助于

可能重复的@ASR It's not duplicate我的问题不同,我为此挣扎了几天,但我仍然没有解决它。您是否尝试了针对该问题指定的推荐解决方案/答案?是的,我已经试过了,但仍然没有解决