Linked backend to frontend and fixed basic formatting in few files
This commit is contained in:
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace api;
|
||||
use PDO;
|
||||
|
||||
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, isMainProject, information, imgLocation, projectLink, githubLink FROM projects order by date LIMIT 4;");
|
||||
$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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user