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

15
add_project.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
if (!isset($data['name']) || empty(trim($data['name']))) {
http_response_code(400);
echo json_encode(['error' => 'Project name is required']);
exit;
}
$stmt = $pdo->prepare("INSERT INTO projects (name) VALUES (?)");
$stmt->execute([trim($data['name'])]);
echo json_encode(['success' => true, 'id' => $pdo->lastInsertId()]);
?>