I am trying to update the table but nothing is changing. The database name and fields are correct.
<?php
require("config.php");
$forname = $_POST['name'];
$newval = "yes";
mysqli_query($con, "UPDATE pupils SET signin = '$newval' WHERE forname = '$forname'");
mysqli_close($con);
?>
Help appreciated! Thanks,
UPDATE
Appears that data is not posting correctly for some reason.
<form class="form-inline" name="markin" role="form" method="POST" action="markin.php">
<div class="form-group">
<select class="form-control" name"name" id="name">
<?php
$query = "SELECT * FROM `pupils` WHERE signin = 'no'";//Grab the data
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_array($result)) {//Creates a loop to loop through results
echo "<option>" . $row['forname'] . "</option>";//$row['index'] the index here is a field name
}
?>
</select>
</div>
<button type="submit" class="btn btn-success">Mark in</button>
</form>