diff --git a/lib/C3GovConnector.php b/lib/C3GovConnector.php index c5d0d86..99ba657 100644 --- a/lib/C3GovConnector.php +++ b/lib/C3GovConnector.php @@ -23,6 +23,15 @@ class C3GovConnector return $result->fetch_assoc(); } + public function getCos($testId){ + $sql = "SELECT * FROM cos WHERE testId = ?"; + $stmt = $this->dbConnection->prepare($sql); + $stmt->bind_param("s", $testId); + $stmt->execute(); + $result = $stmt->get_result(); + return $result->fetch_assoc(); + } + public function __destruct() { $this->dbConnection->close(); } diff --git a/public/cos.php b/public/cos.php new file mode 100644 index 0000000..94009e5 --- /dev/null +++ b/public/cos.php @@ -0,0 +1,16 @@ + 'No test id provided' ] )); +} +else { + $c3gov = new C3GovConnector(); + echo( json_encode($c3gov->getCos($testId))); +} \ No newline at end of file