我已经尝试了所有我能想到的方法,但当我尝试运行它时仍然出现以下错误。我认为这是一个小错误,因为我从其他地方拼接和切割了这段代码,但为了我,我似乎无法弄清楚。
致命错误:未捕获异常:PDOException:SQLSTATE [42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;查看与您的 MariaDB 服务器版本相对应的手册,了解在 '['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 中抛出
<?php
session_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";
}
我在想我的语法完全错误,或者我放错了地方,但我已经盯着这个看了很长时间,我没有看到我的错误。
HUH函数
慕田峪9158850