If it possible to edit my status field in my database when I check the checkbox?
What I want is, when I check multiple rows in my table it updates automatically the value of row['status'] in the database into yes after I submit.
Just like this,
Table APP
counter | status
100001 |
100002 |
100003 |
100004 |
And when I checked the 100001 and 100002 the value of status changed to yes.
counter | status
100001 | yes
100002 | yes
100003 |
100004 |
Below is my short code below.
<form name="form1" method="post" action="">
<?php
$mysqli = new mysqli("localhost", "root", "", "app");
$result1 = $mysqli->query("SELECT * FROM APP");
echo'<table id="tfhover">
<tr>
<th>status</th>
<th></th>
</tr>';
while($row = $result1->fetch_assoc()){
echo
'<tr>
<td>'.$row['status'].'</td>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="'.$row['counter'].'"></td>
</tr></table>';
?>
<input id='edit' type='submit' class='button' name='edit' value='Edit'/>
</form>
<?
if(isset($_POST['edit']))
{
}
?>
If it is possible to do this? Help ?