2017-05-08 15 views
0

私は現在、配置されている現在のチケットのデータを挿入する場所に作成しようとしていますが、挿入されません。データはデータベースに挿入されません[PHP]

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."); 
    } 
} 

エラーはありませんが、テーブルには挿入されません。

+0

「保留中」は文字列ですか? – chris85

+1

'pending'!==':pending' – RiggsFolly

+1

あなたは '保留中 'を束縛していません – RiggsFolly

答えて

0

私はそれを理解しました!この問題はGETDATE()機能の原因でした。

関連する問題