<?php
include 'dbconfig.php';
$conn = $dbConnection;
$query = "
UPDATE Events
SET title=:title, resource=:resource, start_event=:start_event, end_event=:end_event
WHERE id=:id
";
$statement = $conn->prepare($query);
$start = date_create_from_format('D M d Y H:i:s \G\M\TO+', $_POST['start'])->format('Y-m-d H:i:s');
$end = date_create_from_format('D M d Y H:i:s \G\M\TO+', $_POST['end'])->format('Y-m-d H:i:s');
$statement->execute(array(
':id' => $_POST['id'],
':title' => $_POST['title'],
':resource' => $_POST['resource'],
':start_event' => $start,
':end_event' => $end
)
);
?>
Error:
[Sat Mar 30 02:47:19.549392 2019] [php7:error] [pid 25123] [client ***]
PHP Fatal error: Uncaught Error: Call to a member function format() on boolean in /var/app/current/insert.php:14
Stack trace:\n#0 {main}\n thrown in /var/app/current/insert.php on line 14, referer: ***.us-west-2.elasticbeanstalk.com/
preferences:
25.35 ms | 404 KiB | 5 Q