0
我有这个查询显示两个输入值,因为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);
任何帮助,将不胜感激!
非常感谢我的错误我纠正它,它仍然不工作 – baptpro
任何人都可以帮助我吗? – baptpro
你能得到实际的sql错误信息吗?否则真的很难猜到出现了什么问题 – ggg