created backend for project section and updated the css for the images

This commit is contained in:
2021-09-28 11:29:26 +01:00
parent 33dd85d162
commit 9a282cb305
6 changed files with 57 additions and 8 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
require_once "./config.php";
/**
* Project Data Class
* Define all functions which either get, update, create or delete timeline data
*/
class ProjectData
{
function getProjectData()
{
$conn = dbConn();
$stmt = $conn->prepare("SELECT title, information, imgLocation, projectLink, githubLink FROM projects;");
$stmt->execute();
// set the resulting array to associative
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($result)
{
return $result;
}
else
{
return array(array("errorMessage" => "Error, project data not found"));
}
}
}