簡體   English   中英

完整日歷未更新到數據庫

[英]Full calendar not updating to database

我已經搜索並嘗試了幾乎所有我遇到的一切都沒有運氣。 所有正確的參數都顯示在控制台日志中,但不知何故沒有傳遞到數據庫。 希望有人可以對此有所了解。

更新.php

<?php

/* Values received via ajax */
$Job = $_POST['id'];
$date_assigned = $_POST['start'];

// connection to the database
try {
    $bdd = new PDO('mysql:host=localhost;dbname=service', 'root', 'root');
} catch(Exception $e) {
    exit('Unable to connect to database.');
}
    // update the records
    $sql = "UPDATE install SET date_assigned=? WHERE Job=?";
    $q = $bdd->prepare($sql);
    $q->execute(array($date_assigned,$Job));
?>
$.ajax({
    type: 'POST',
    url: 'update.php',
    data: 'title=' + info.event.title + '&start='+ start + '&id='+ info.event.id ,
    success: function(json) {
        console.log('succes:', info.event.title);
        console.log('start:', start);
        //console.log('Eind tijd:', info.event.end.toISOString().slice(0, 19).replace('T', ' '));
        console.log('ID:', info.event.id);
        console.log('auto:', recourceid);
        calendar.rerenderEvents();
    }
});

所以,對我來說答案很簡單。 我的數據庫沒有設置密碼,我在連接中指定了一個。 一旦我刪除它按預期工作。 感謝您的幫助。 很抱歉浪費時間在我應該抓住的愚蠢的事情上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM