Skip to content
Snippets Groups Projects
Commit 15fe6241 authored by Florian Burgener's avatar Florian Burgener
Browse files

Add results sorting

parent b9055c36
No related branches found
No related tags found
No related merge requests found
...@@ -6,5 +6,5 @@ use App\DB; ...@@ -6,5 +6,5 @@ use App\DB;
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
$data = DB::run("SELECT * FROM educations"); $data = DB::run("SELECT * FROM educations ORDER BY endDate DESC");
echo json_encode($data); echo json_encode($data);
...@@ -6,7 +6,7 @@ use App\DB; ...@@ -6,7 +6,7 @@ use App\DB;
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
$data = DB::run("SELECT * FROM experiences"); $data = DB::run("SELECT * FROM experiences ORDER BY endDate DESC");
for ($i = 0; $i < count($data); $i++) { for ($i = 0; $i < count($data); $i++) {
$data[$i]['tasks'] = DB::run('SELECT * FROM tasks WHERE experience_id = ?', $data[$i]['id']); $data[$i]['tasks'] = DB::run('SELECT * FROM tasks WHERE experience_id = ?', $data[$i]['id']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment