prepare("SELECT * FROM elections WHERE id = ?"); $stmt->execute([$id]); $election = $stmt->fetch(); if (!$election) die("Election not found"); // Summary stats $vStmt = $pdo->prepare("SELECT COUNT(DISTINCT voter_id) FROM votes WHERE election_id = ?"); $vStmt->execute([$id]); $totalVoters = $vStmt->fetchColumn(); // Positions and results $positions = $pdo->prepare("SELECT * FROM positions WHERE election_id = ? ORDER BY sort_order ASC"); $positions->execute([$id]); $positions = $positions->fetchAll(); ?>
= $election['status'] ?> Election
Results will be available once the election starts.