I am trying to develop a simple page in php to update attendance days.I have set the query to display the records from db and added a check box with data displayed from db.I want to update the specific record of db on which check box is checked.i want to update the the attendance column with 1 to existing value.for this i just tried written code to display the data from db and added a check box but dnt know to update the record where check box is checked on submit button.here is my initial code.any one help
<?php
require_once("../db/db_connect.php");
$db = new DB_CONNECT();
$sql = "SELECT cv_id, cd_id, cv_fomfeeback FROM candidateverification;";
$res = pg_query($sql) or die ($sql);
// output data of each row
while($row = pg_fetch_row($res)){
echo "cd id: " . $row[0]. " cv id: " . $row[1]. " atn: " . $row[2]. "<input type='checkbox' value='1'/> <br>";
}
?>
<html lang="en">
<head>
<body>
<input type="button" action="update" value="Submit"/>
</body>
</html>
I want to update cv_fomfeeback column with +1 if check box is checked.