私は結果にNULL値を受け取る:タイトルが、DBに値がlocation_endどのように私のSQLからイベントを取得 - FULLカレンダー
<?php
$bdd = new PDO('mysql:host;dbname', 'user', 'pass');
$result = $bdd->prepare("SELECT * FROM schedule");
$result->execute();
$event_array = array();
$result->setFetchMode(PDO::FETCH_ASSOC);
while ($record = $result->fetch()) {
$event_array[] = array(
'id' => $record['id'],
'title' => $record['location_end'],
'start' => $record['start_time'],
'end' => $record['end_time'],
);
}
echo json_encode($event_array);
events: {
url: 'http://localhost/FleetManagement/getEvents.php',
type: 'POST',
dataType: 'json',
success: function(){
alert('Get Events Successfull!!');
$('#calendar').fullCalendar('updateEvent',event);
},
error: function(error) {
alert(error);
}
}
結果であります。タイトルは値を持つ必要がありますが、私はnullを受け取る
その結果、タイトルresult [{"id":"1","title":null,"start":"2016-01-14 00:15:00","end":"2016-01-14 01:00:00"},{"id":"2","title":null,"start":"2016-01-20 23:45:00","end":"2016-01-20 23:45:00"},{"id":"3","title":null,"start":"2016-01-14 23:45:00","end":"2016-01-14 23:45:00"},{"id":"4","title":null,"start":"2016-01-14 23:45:00","end":"2016-01-14 23:45:00"}]
最新のソースコードが見つかりません、私は私のクエリを編集しました!同じ結果nullタイトルの値 – Dayle