Location: PHPKode > projects > PHPOLL php - mysql poll system > phpoll_files/cookies/contatutto.php
<?php

/*

This file is part of PHPOLL.

    PHPOLL is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    PHPOLL is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PHPOLL; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

include "contest2007/config/config.php";

// assegno le variabili di connessione
$phpoll_db = mysql_connect ($phpoll_host, $phpoll_user, $phpoll_password)
	or die ("Errore nella connessione a MySQL");
	
// selezione del database
mysql_select_db($phpoll_database, $phpoll_db)
	or die ("Errore nella connessione al database ".$phpoll_database);
	
// QUERY per MySQL
$query_band = "SELECT * FROM ".$tab_band.";";

$estrai_band = mysql_query($query_band, $phpoll_db)
	or die ("Errore nella connessione per estrazione band al database ".$database);	

while ($dati_band=mysql_fetch_assoc ($estrai_band)) {
	
	$totale=$totale+$dati_band['voti'];

}

print "totale voti = ".$totale;

mysql_close ($phpoll_db);


?>
Return current item: PHPOLL php - mysql poll system