Skip to content
Snippets Groups Projects
Commit 510a20d5 authored by MHEN2606's avatar MHEN2606
Browse files

feat: Get All Scholarship API for REST

parent 4b130cba
Branches
Tags
No related merge requests found
<?php
require_once '../../app/core/App.php';
require_once '../../app/core/Database.php';
require_once '../../app/models/Scholarship.php';
require_once '../../config/config.php';
$scholarship = new Scholarship(0,0);
$data = $scholarship->getAllScholarshipREST();
$results = mysqli_fetch_all($data, MYSQLI_ASSOC);
echo json_encode($results);
?>
\ No newline at end of file
...@@ -189,6 +189,15 @@ class Scholarship ...@@ -189,6 +189,15 @@ class Scholarship
} }
public function getAllScholarshipREST(){
$query = "SELECT user_id, scholarship_id, title, description, short_description, coverage, contact_name, contact_email
FROM $this->table";
$stmt = $this->db->setSTMT($query);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
return $result;
}
public function getAllScholarship($offset, $limit){ public function getAllScholarship($offset, $limit){
$query = ''; $query = '';
$stmt = null; $stmt = null;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment