I am trying to save the result of the radio button voting into the database mysql. html is as follow while in the database i have one poll table in test database. 1. save the radio button result in the database on the top of already voted if the vote is 1 by clicking the second time it should be 2 email address is not important if only one user can vote one time maybe cookies please help
foodID (int primary Auto increment)
foodName (names of four food)
foodRate(rating to be updated if a user clicked +1)
email(email address)
<form id="form_poll" action="includes/result.php" method="post">
<div id="email">
<label><span>Email : </span> <input type="text" name="email" class="email" size="50px" placeholder="Your Email here" required></label><br />
</div>
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<label class="rad"> <input type="radio" class="btn" name="button" value="1" alt=""><i><img src="images/burger.png" alt="bulls burger" id="image1">
</i></label>
</td>
</tr>
<tr>
<td ><label class="rad"> <input type="radio" class="btn" name="button" value="2" alt=""><i><img src="images/pizza.png" alt="pizza" id="image2"></i></label></td>
</tr>
<tr>
<td ><label class="rad"> <input type="radio" class="btn" name="button" value="3" alt=""><i><img src="images/bol.png" alt="pasta b" id="image2"></i></label></td>
</tr>
<tr>
<td ><label class="rad"> <input type="radio" class="btn" name="button" value="4" alt=""><i><img src="images/lasania.png" alt="pasta l" id="image2"></i></label></td>
</tr><br />
</tbody>
</table>
in result.php
<?php
$connect =include('connection.php');
if(isset($_POST['submit']))
{
if(isset($_POST['button'], $_POST['email']))
{
//mysqli_query($connect, "UPDATE poll SET
}
else
{
echo"you did not select you choice";
}
}
?>