2021-08-22 10:44:49 +01:00
|
|
|
<?php
|
2021-08-23 21:38:37 +01:00
|
|
|
require_once "./config.php";
|
2021-08-22 10:44:49 +01:00
|
|
|
|
|
|
|
class TimelineData
|
|
|
|
{
|
2021-08-23 09:30:08 +01:00
|
|
|
function getTimelineData()
|
|
|
|
{
|
|
|
|
$conn = dbConn();
|
|
|
|
$stmt = $conn->prepare("SELECT * FROM timeline;");
|
|
|
|
$stmt->execute();
|
2021-08-22 10:44:49 +01:00
|
|
|
|
2021-08-23 09:30:08 +01:00
|
|
|
// set the resulting array to associative
|
|
|
|
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
|
|
|
|
if ($result)
|
|
|
|
{
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return array("errorMessage" => "Error timeline data not found");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-08-22 10:44:49 +01:00
|
|
|
}
|