php - 更新语句未更新表数据(未回答)
问题描述
我正在尝试使用 mysql.MY 中的 Update 语句更新员工的记录。我的查询显示消息“员工记录已成功更新”但它没有在表中更新我的代码是这样的
{
$eid=intval($_GET['uin']);
$uin=$_POST['uin'];
$fname=$_POST['firstName'];
$lname=$_POST['lastName'];
$email=$_POST['email'];
$department=$_POST['department'];
$recoffr=$_POST['recoffr'];
$mobileno=$_POST['mobileno'];
$sql="
update tblemployees
set FirstName = :fname
, LastName = :lname
, email = :email
, department = :department
, recoffr = :recoffr
, Phonenumber = :mobileno
where uin = :eid
";
$query = $dbh->prepare($sql);
$query->bindParam(':eid',$uin,PDO::PARAM_STR);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':lname',$lname,PDO::PARAM_STR);
$query->bindParam(':email',$email,PDO::PARAM_STR);
$query->bindParam(':department',$department,PDO::PARAM_STR);
$query->bindParam(':recoffr',$recoffr,PDO::PARAM_STR);
$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);
$query->execute();
$msg="Employee record updated Successfully";
}
我的表结构是表结构
解决方案
推荐阅读
- java - 如何在 Redis 中存储 Tomcat 会话
- node.js - 在我的整个 express 应用上使用 Multer 中间件有什么缺点吗?
- amazon-web-services - 我可以创建不引用特定用户的 Cognito 兼容 JWT 吗?
- android - 在不取消导航的情况下使用 Intent 切换到 Android 上的 Google 地图
- javascript - 我该如何解决控制台。错误:这是一个空操作,但它表明您的应用程序中存在内存泄漏
- javascript - 他们在评估预请求脚本时出错:无法读取未定义的属性“获取”
- c# - dotnet ef 不尊重配置
- python - 熊猫剪影分数的正确数据格式
- spring - Spring Integration DSL:如何添加 HTTP.outboundGateway 标头?
- gitlab - gitkraken 无法连接到 gitlab 无效参数