// Retreving poll from database
$res = mysql_query("select * from poller where ID='1'");
if($inf = mysql_fetch_array($res)){
echo "
".$inf["pollerTitle"]."
"; // Output poller title
$resOptions = mysql_query("select * from poller_option where pollerID='1' order by pollerOrder") or die(mysql_error()); // Find poll options, i.e. radio buttons
while($infOptions = mysql_fetch_array($resOptions)){
if($infOptions["defaultChecked"])$checked=" checked"; else $checked = "";
echo "
";
}
}
?>
Getting poll results. Please wait...
This is an example of a poll script. It uses Ajax to send your vote to the server. Ajax is also used to return the results from this poll to your browser.