# poll-maker/6.4.2/admin/partials/results/poll-maker-ays-answer-results-actions.php

Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls, version 6.4.2. 27 lines.

- Page: https://pluginprobe.com/plugins/poll-maker/6.4.2/code/admin/partials/results/poll-maker-ays-answer-results-actions.php
- Raw: https://pluginprobe.com/plugins/poll-maker/6.4.2/raw/admin/partials/results/poll-maker-ays-answer-results-actions.php
- Modified: 2026-07-09T13:11:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/poll-maker/6.4.2/code/admin/partials/results/poll-maker-ays-answer-results-actions.php#L10-L20`.

```php
<?php 
    class Poll_Answer_Results{
        private $plugin_name;

        public function __construct( $plugin_name ) {
            $this->plugin_name = $plugin_name;
        }

        // Get Polls
        public function get_polls(){
            global $wpdb;
            $polls_table = $wpdb->prefix."ayspoll_polls";
            $sql = "SELECT id,title FROM ".$polls_table;
            $result = $wpdb->get_results($sql , "ARRAY_A");
            return $result;
        }

        // Get answers
        public function get_poll_answers($id){
            global $wpdb;
            $answers_table = $wpdb->prefix."ayspoll_answers";
            $sql = "SELECT * FROM ".$answers_table." WHERE poll_id=".$id." AND show_user_added = 1";
            $result = $wpdb->get_results($sql , "ARRAY_A");
            return $result;
        }
    }
?>
```
