query("SELECT * FROM spbu ORDER BY created_at DESC"); $rows = $stmt->fetchAll(); echo json_encode($rows); } catch (PDOException $e) { http_response_code(500); echo json_encode(['error' => 'Gagal mengambil data: ' . $e->getMessage()]); }