我有这个查询显示两个输入值,因为在表中找到了两次id字段。
<form action="edit_batch.php" method="post" >
$sql="select Batch_Name from claims_follow_up.batch where id='$id'";
$req=mysqli_query($dbc,$sql) or die("Erreur d'execution");
while($tab=mysqli_fetch_array($req))
{
?>
<label>Batch Name</label>
<input type="text" name= "batch" value='<?=$tab['Batch_Name']?>' required><br>
<?php
}
?>
</form>
我想编辑这些值,但我失败了,我在这里尝试:
edit_batch.php
include_once('connection.php');
$batch=mysqli_real_escape_string($dbc,$_POST['batch']);
$belong=intval($_POST['belong']);
$sql = "update claims_follow_up.batch set Batch_Name='$batch' where belong='$belong'";
$res = mysqli_query($dbc, $sql);
任何帮助将不胜感激!
答案 0 :(得分:0)