Updated SQL File to remove dummy data.

This commit is contained in:
Garcia-Gomez
2026-01-26 13:02:02 -08:00
commit 40aa44fd7a
21 changed files with 1977 additions and 0 deletions

19
get_data.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
require 'db.php';
$projects = $pdo->query("SELECT * FROM projects ORDER BY sort_order ASC")->fetchAll();
foreach ($projects as &$project) {
$stmt = $pdo->prepare("SELECT * FROM tasks WHERE project_id = ? ORDER BY created_at");
$stmt->execute([$project['id']]);
$project['tasks'] = $stmt->fetchAll();
foreach ($project['tasks'] as &$task) {
$stmt = $pdo->prepare("SELECT * FROM subtasks WHERE task_id = ? ORDER BY created_at");
$stmt->execute([$task['id']]);
$task['subtasks'] = $stmt->fetchAll();
}
}
echo json_encode($projects);
?>