I have created a bootstrap calendar and I want to retrieve the event from the sql database but it is not working
I stored the start_date
and end_date
in the calendar with datetime
data type
I followed some tutorial and write this piece of php code:
<?php
include_once ("dbconnection.php");
//load.php
$data = array();
$query = "SELECT * FROM Event ORDER BY event_id";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row)
{
$data[] = array(
'id' => $row[.'event_id'.],
'title' => $row[.'Title'.],
'start' => $row[.'start_date'.],
'end' => $row[.'end_date'.]
);
}
echo json_encode($data);
?>
after i run the code there is no event in the calendar