G' day! my code here was good..
<?php
if(isset($_GET['btnsubmit'])){
$can = array($_GET['pres'],$_GET['vp']);
mysql_connect('localhost','root');
mysql_select_db('sample_poll');
foreach($can as $val){
$sql = mysql_query( "UPDATE candidate SET votes=votes+1 where can_id='".$val."'" );
}
echo "<h1>vote complete!</h1>
<a href='voteresult.php'>see all vote results</a>";
}else{
echo "<form method='get'>
<h2><center>Select Candidates</h2>
<h3>president:</h3>
1.) lace <input type='radio' name='president' value='1'>
2.) lawrence <input type='radio' name='president' value='2'>
<h3>vice-president:</h3>
1.) neji <input type='radio' name='vice_president' value='3'><br />
2.) lee <input type='radio' name='vice_president' value='4'>
<p><input type='submit' name='btnsubmit' value='VOTE'></p>
</form>";
}
?>
the name lace,lawrence,neji and lee
is given..i want to display the names saved in database by president and vice_president..