Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- mysql_connect('localhost','DB_USER','DB_PASS'); mysql_select_db('DB_NAME');
- $pol = $_POST['pol'];
- $query = "select jumlah from polling where opsi='$pol'";
- $result = mysql_query($query);
- $tcount = mysql_fetch_array($result);
- $tcount = $tcount['jumlah']+1;
- $query1 = "update polling SET jumlah='$tcount' where opsi='$pol'";
- $result1 = mysql_query($query1);
- echo "<h2><p align='center'>Total vote untuk $pol sementara adalah : ".$tcount."</p></h2>";
- echo "Hasil voting sementara adalah:";
- $html = mysql_fetch_array(mysql_query("select jumlah from polling where opsi='HTML'"));
- echo "<br>HTML : ".$html['jumlah']." suara";
- $php = mysql_fetch_array(mysql_query("select jumlah from polling where opsi='PHP'"));
- echo "<br>PHP : ".$php['jumlah']." suara";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement