Location: PHPKode > projects > EasyFest > new/viewPolls.php
<?php
	include_once("include/db_connection.php");
	session_start();
	if($_SESSION["adminloggedIn"] == FALSE){
				header("Location:admin_login.php");
				exit;
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Easy Fest</title>
</head>
<body>
<?php




$result1 = mysql_fetch_array(mysql_query("SELECT PollDescription FROM polls ORDER BY (PollId) DESC "));
$result = mysql_query("SELECT PollId FROM polls ORDER BY (PollId) DESC ");
$index=0;
while($row = mysql_fetch_array($result))
  {
	$TableName="Poll"."$row[$index]";
	
	echo $TableName;
	$PollResponse1 = mysql_fetch_array(mysql_query("SELECT SUM(Response1) FROM $TableName"));

  echo "<br />";
  echo "$PollResponse1[0]";
	$PollResponse2 = mysql_fetch_array(mysql_query("SELECT SUM(Response2) FROM $TableName"));

  echo "<br />";
  echo "$PollResponse2[0]";
	$PollResponse3 = mysql_fetch_array(mysql_query("SELECT SUM(Response3) FROM $TableName"));
	
  echo "<br />";
  echo "$PollResponse3[0]";
	$PollResponse4 = mysql_fetch_array(mysql_query("SELECT SUM(Response4) FROM $TableName"));
	
  echo "<br />";
  echo "$PollResponse4[0]";
	$PollResponse5 = mysql_fetch_array(mysql_query("SELECT SUM(Response5) FROM $TableName"));

  echo "<br />";
  echo "$PollResponse5[0]";
  $index++;
  }

?>
Return current item: EasyFest