我已經(jīng)嘗試了所有我能想到的方法,但當(dāng)我嘗試運行它時仍然出現(xiàn)以下錯誤。我認(rèn)為這是一個小錯誤,因為我從其他地方拼接和切割了這段代碼,但為了我,我似乎無法弄清楚。致命錯誤:未捕獲異常:PDOException:SQLSTATE [42000]:語法錯誤或訪問沖突:1064 您的 SQL 語法有錯誤;查看與您的 MariaDB 服務(wù)器版本相對應(yīng)的手冊,了解在 '['ADPs'],owner=[''],type=[''],company=[''],status=['Active 附近使用的正確語法'],soc=['yes'],email=[' 在 C:\xampp\htdocs\updateVendor.php 中的第 1 行:129 堆棧跟蹤:#0 C:\xampp\htdocs\updateVendor.php(129): PDOStatement->execute() #1 {main} in C:\xampp\htdocs\updateVendor.php:136 堆棧跟蹤:#0 {main} 在第 136 行的 C:\xampp\htdocs\updateVendor.php 中拋出<?phpsession_start();/* Include the database connection file (remember to change the connection parameters) */require './db_inc.php';/* Include the Account class file */require './account_class.php';/* Create a new Account object */$account = new Account();$user = $_SESSION['username'];$login = FALSE;$id = $account->getIdFromName($user);try{ $login = $account->sessionLogin();}catch (Exception $e){ echo $e->getMessage(); die();}if ($login){}else{ header('Location: ./index.php');} $name = $_POST['vendor']; $owner = $_POST['owner']; $status = $_POST['status']; $company = $_POST['company']; $email = $_POST['email']; $type = $_POST['type']; $descr = $_POST['descr']; $owner_email = $_POST['owner_email']; $inherit = $_POST['inherit']; $residual = $_POST['residual']; if(isset($_POST['mfa'])){ $mfa = "1"; } else { $mfa = "0"; } if(isset($_POST['policy'])){ $policy = "1"; } else { $policy = "0"; } if(isset($_POST['dr'])){ $dr = "1"; } else { $dr = "0"; } if(isset($_POST['ir'])){ $ir = "1"; } else { $ir = "0"; } if(isset($_POST['media'])){ $media = "1"; } else { $media = "0"; } if(isset($_POST['remoteaccess'])){ $remoteaccess = "1"; } else { $remoteaccess = "0"; }我在想我的語法完全錯誤,或者我放錯了地方,但我已經(jīng)盯著這個看了很長時間,我沒有看到我的錯誤。
如何在 php 中為 SQL 編寫 UPDATE
哆啦的時光機(jī)
2022-10-14 15:04:21
