diff --git a/dist/api/projectData.php b/dist/api/projectData.php new file mode 100644 index 0000000..9125f2a --- /dev/null +++ b/dist/api/projectData.php @@ -0,0 +1,31 @@ +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")); + } + } +} \ No newline at end of file diff --git a/dist/api/timelineData.php b/dist/api/timelineData.php index a9fc5e2..e3f2068 100644 --- a/dist/api/timelineData.php +++ b/dist/api/timelineData.php @@ -1,11 +1,14 @@ prepare("SELECT title, information, imgLocation, projectLink, githubLink FROM projects;"); + $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