[英]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.