Updated timeline route for both education and work

This commit is contained in:
2021-08-27 21:18:19 +01:00
parent 1e742ed654
commit 539e6cc23d
3 changed files with 49 additions and 9 deletions
+24 -4
View File
@@ -3,10 +3,10 @@ require_once "./config.php";
class TimelineData
{
function getTimelineData()
function getEduData()
{
$conn = dbConn();
$stmt = $conn->prepare("SELECT * FROM timeline;");
$stmt = $conn->prepare("SELECT * FROM edu;");
$stmt->execute();
// set the resulting array to associative
@@ -18,8 +18,28 @@ class TimelineData
}
else
{
return array("errorMessage" => "Error timeline data not found");
return array("errorMessage" => "Error, edu data not found");
}
}
function getWorkData()
{
$conn = dbConn();
$stmt = $conn->prepare("SELECT * FROM work;");
$stmt->execute();
// set the resulting array to associative
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($result)
{
return $result;
}
else
{
return array("errorMessage" => "Error, work data not found");
}
}
}