query("SELECT COUNT(*) FROM poll_votes")->fetchColumn(); // Prepare the data for the chart $data = [['Option', 'Votes']]; foreach ($options as $id => $option) { // Get the vote count for this option $vote_count = $db->query("SELECT COUNT(*) FROM poll_votes WHERE option_id=$id")->fetchColumn(); // Add the data for this option to the chart data $data[] = [$option, $vote_count]; } ?>