false]; if ($num) { try { $pdo = db_connect(); $sql = "SELECT slatlist FROM chandj.output WHERE num = ?"; $stmh = $pdo->prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_INT); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); if ($row) { $response['success'] = true; $response['slatlist'] = json_decode($row['slatlist'], true); } else { http_response_code(404); $response['message'] = "No data found"; } } catch (PDOException $e) { http_response_code(500); $response['message'] = "Error: " . $e->getMessage(); } } echo json_encode($response); ?>