Amは既にこのように作成され、完璧ですが、最後の2つのフォームが機能していない場合、警告:未定義変数:reg_noとコストが表示されます。前のフォームと同じアルゴリズムを実行しようとしていますが、何も起こりません。私の目標は、挿入されたデータを更新することであり、ここで私の形であるphpmyadminからデータをエコーすることができません
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Edit invoice</title>
<link rel="stylesheet" href="box_style.css" />
</head>
<body>
<?php
\t
include ("db_con.php");
if(isset($_GET['edit_invoice'])){
$edit_i_id = $_GET['edit_invoice'];
$select_invoice = "select * from invoice where i_id='$edit_i_id'";
$run_query = mysqli_query($con, $select_invoice);
while ($row_invoice=mysqli_fetch_array($run_query)){
\t \t \t
\t \t $i_id = $row_invoice['i_id']; \t
$reg_no = $row_invoice['reg_no'];
$cost = $row_invoice['cost'];
}
}
?>
<div class='form'>
<form action="" method="post" enctype="multipart/form-data" >
\t
<table width="745" align="center" border="2">
\t
\t
<p style="text-align: center;"><strong><span style="text-decoration: underline;">EDIT INVOICE:</span></strong></p>
\t
\t <tr> \t \t
\t \t <td align="right" bgcolor="#dbe5f1"><strong>Registration Number:</strong></td>
\t \t <td><input type="text" name="reg_no" id="reg_no" size="35" class="text" placeholder="Registration Number" value="<?php echo $reg_no; ?>" required=""/></td> \t \t
\t </tr>
\t
\t <tr> \t \t
\t \t <td align="right" bgcolor="#dbe5f1"><strong>Cost(Tshs):</strong></td>
\t \t <td><input type="text" name="cost" id="cost" size="35" class="text" placeholder="Cost" value="<?php echo $cost; ?>" required=""/></td>
\t </tr>
\t
\t <tr>
\t \t <td colspan="6" align="center" bgcolor="#dbe5f1" ><input type="submit" name="update" class="submit-button" value="SAVE CHANGES"></td> \t \t
\t </tr>
\t
\t </table>
\t
</form>
</div>
</body>
</html>
HTTPS([** SQLインジェクション攻撃**] ://stackoverflow.com/q/60174/5914775)。 [Little Bobby Tables](http://bobby-tables.com/)に何が起こったのか見てみましょう。 [あなたが入力を逃れている場合でも、安全ではありません!](https://stackoverflow.com/q/5741187/5914775)。代わりに、[prepared parameterized statements](https://php.net/manual/en/mysqli.quickstart.prepared-statements.php)を使用してください。 –