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

18
add_task.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
$name = trim($data['name'] ?? '');
$project_id = intval($data['project_id'] ?? 0);
if ($name === '' || $project_id <= 0) {
http_response_code(400);
echo json_encode(['error' => 'Invalid input']);
exit;
}
$stmt = $pdo->prepare("INSERT INTO tasks (project_id, name) VALUES (?, ?)");
$stmt->execute([$project_id, $name]);
echo json_encode(['success' => true, 'id' => $pdo->lastInsertId()]);
?>