我有一个作为弹出窗口打开的表单,它用于插入或更新数据。有一个按钮可以更新数据库中的数据但不关闭弹出窗口。更新/插入后它保持打开状态。
我尝试了以下代码但无法实现
<?php
if(isset($_POST['modify']))
{
$aba11=$_POST['aba11'];
$aba12=$_POST['aba12'];
$aba13=$_POST['aba13'];
$aba21=$_POST['aba21'];
$aba22=$_POST['aba22'];
$aba23=$_POST['aba23'];
$aba31=$_POST['aba31'];
$aba32=$_POST['aba32'];
$aba33=$_POST['aba33'];
$aba41=$_POST['aba41'];
$aba42=$_POST['aba42'];
$aba43=$_POST['aba43'];
$sampleid=$_GET['sampleid'];
$sql="UPDATE tblaba SET aba11=:aba11,aba12=:aba12,aba13=:aba13,aba21=:aba21,aba22=:aba22,aba23=:aba23,aba31=:aba31,aba32=:aba32,aba33=:aba33,aba41=:aba41,aba42=:aba42,aba43=:aba43 where sampleid=:sampleid";
$query = $dbh->prepare($sql);
$query->bindParam(':sampleid',$sampleid,PDO::PARAM_STR);
$query->bindParam(':aba11',$aba11,PDO::PARAM_STR);
$query->bindParam(':aba12',$aba12,PDO::PARAM_STR);
$query->bindParam(':aba13',$aba13,PDO::PARAM_STR);
$query->bindParam(':aba21',$aba21,PDO::PARAM_STR);
$query->bindParam(':aba22',$aba22,PDO::PARAM_STR);
$query->bindParam(':aba23',$aba23,PDO::PARAM_STR);
$query->bindParam(':aba31',$aba31,PDO::PARAM_STR);
$query->bindParam(':aba32',$aba32,PDO::PARAM_STR);
$query->bindParam(':aba33',$aba33,PDO::PARAM_STR);
$query->bindParam(':aba41',$aba41,PDO::PARAM_STR);
$query->bindParam(':aba42',$aba42,PDO::PARAM_STR);
$query->bindParam(':aba43',$aba43,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
{
$_SESSION['msg']="Sample Updated successfully";
self.close ();
}
至尊宝的传说
冉冉说
相关分类