简体   繁体   English

完整日历未更新到数据库

[英]Full calendar not updating to database

I've searched and tried just about everything I have come across with no luck.我已经搜索并尝试了几乎所有我遇到的一切都没有运气。 All of the proper parameters show up in the console log but somehow are not getting passed on to the database.所有正确的参数都显示在控制台日志中,但不知何故没有传递到数据库。 Hoping someone can shed some light on this.希望有人可以对此有所了解。

update.php更新.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();
    }
});

So, the answer for me was simple.所以,对我来说答案很简单。 There is no password set to my database and I was specifying one in my connection.我的数据库没有设置密码,我在连接中指定了一个。 Once I removed that it worked as expected.一旦我删除它按预期工作。 Thank you for the help.感谢您的帮助。 Sorry for wasting time on something silly that I should have caught.很抱歉浪费时间在我应该抓住的愚蠢的事情上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM