我的網站的panel.php頁面顯示用戶帳戶信息。該頁面顯示輸入中的數據,用戶可以更新,但點擊更新按鈕時會出現錯誤。Sql更新錯誤
我拿了這個錯誤;
您的SQL語法錯誤;檢查 對應於你的MySQL服務器版本使用 附近 '(FNAME,LNAME,郵箱,密碼,國家,性別,Facebook,微博, 的Instagram,snapc' 在行正確的語法手冊1
Panel.php
<form action="panelpost.php" method="post">
First name: <input type="text" name="fname" value="<?php echo $row1['fname']; ?>"><br>
Last name: <input type="text" name="lname" value="<?php echo $row1['lname']; ?>"><br>
Mail: <input type="text" name="mail" value="<?php echo $row1['mail']; ?>"><br>
Password: <input type="text" name="password" value="<?php echo $row1['password']; ?>"><br>
Country: <input type="text" name="country" value="<?php echo $row1['country']; ?>"><br>
Sex: <input type="text" name="sex" value="<?php echo $row1['sex']; ?>"><br>
Facebook: <input type="text" name="facebook" value="<?php echo $row1['facebook']; ?>"><br>
Twitter: <input type="text" name="twitter" value="<?php echo $row1['twitter']; ?>"><br>
Instagram: <input type="text" name="instagram" value="<?php echo $row1['instagram']; ?>"><br>
Whatsapp: <input type="text" name="whatsapp" value="<?php echo $row1['snapchat']; ?>"><br>
<input type="submit" value="Update">
</form>
panelpost.php
<?php
include('connect.php');
session_start();
$baslik = $_POST["fname"];
$icerik = $_POST["lname"];
$footer = $_POST["mail"];
$baslik1 = $_POST["password"];
$icerik1 = $_POST["country"];
$footer1 = $_POST["sex"];
$baslik2 = $_POST["facebook"];
$icerik2 = $_POST["twitter"];
$footer2 = $_POST["instagram"];
$baslik3 = $_POST["snapchat"];
$sql = $db->prepare("UPDATE uyeler SET (fname, lname, mail, password, country, sex, facebook, twitter, instagram, snapchat) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) WHERE mail ='{$_SESSION['kullanici']}'");
$ekle = $sql->execute(array(
$baslik,
$icerik,
$footer,
$baslik1,
$icerik1,
$footer1,
$baslik2,
$icerik2,
$footer2,
$baslik3,
));
$hata = $sql->errorInfo();
echo empty($hata[2]) ? "Başarılı Bir Şekilde Çalıştı." : $hata[2];
?>
刪除'SET' –
從查詢中刪除'SET'並檢查。 –
我刪除了,但錯誤仍然存在。我採取同樣的錯誤 – Can