0
我目前一直在嘗試使它插入當前正在放置的票證的數據,但它不會插入。數據將不會插入到數據庫[php] [pdo]
function insertTicketSubmission($title, $subject, $question)
{
global $database;
global $error;
$sth = $database->prepare("INSERT INTO `tickets` (`TicketId`, `PlayerId`, `Title`, `Subject`, `Question`, `Date`, `Status`) VALUES (:TicketID, :PlayerID, :Title, :Subject, :Question, GETDATE(), Pending)");
$sth->bindParam(":TicketID", generateRandomString());
$sth->bindParam(":PlayerID", $_SESSION["userId"]);
$sth->bindParam(":Title", $title);
$sth->bindParam(":Subject", $subject);
$sth->bindParam(":Question", $question);
if($sth->execute())
{
$error = sendError("success", "Your Ticket has been submitted.");
}
}
根本沒有錯誤,只是不會插入表格。
'待定'是一個字符串? – chris85
'pending'!==':pending' – RiggsFolly
而你沒有綁定一個'pending' – RiggsFolly