无法通过加入来更新数据,请团队帮助我以进行更新
$result = "UPDATE manager m INNER JOIN user u ON
m.manager_phone='$manager_phone', m.manager_fax='$manager_fax', m.manager_email='$manager_email', u.fullname='$fullname', u.address='$address',
u.occupation='$occupation' WHERE manager_id='$id'";
$stmt = $connpdo->prepare($result);
$stmt->execute();
if ($stmt)
{
echo "ok";
exit;
}
else
{
echo "fail";
exit;
}
答案 0 :(得分:0)
您的语句格式不正确,没有SET语句。这就是你想要的吗?
$result = "UPDATE manager m
INNER JOIN user u ON m.manager_id = u.user_id
SET m.manager_phone='$manager_phone',
m.manager_fax='$manager_fax',
m.manager_email='$manager_email',
u.fullname='$fullname',
u.address='$address',
u.occupation='$occupation'
WHERE manager_id='$id'
";