i think i am correct.
the code is calling on polls not users.
<?php
require_once 'init.php';
$pollsQuery = $db->query("
SELECT id, question
FROM polls
WHERE DATE(NOW()) BETWEEN starts AND ends
");
var_dump($pollsQuery);
while($row = $pollsQuery->fetchObject()){
$polls[] = $row;
}
echo '<pre>', print_r($polls) ,'</pre>';
?>
& in init i am accessing the correct db
<?php
session_start();
$_SESSION['user_id'] = 1;
$db = new PDO('mysql:host=localhost; dbname=website', 'root', '');
?>