<?php
//Create a new SQLite3 Database
$db = new SQLite3('chckbxs.db');
//Create a new table to our database
$query = "CREATE TABLE IF NOT EXISTS chckbxs (ischecked BOOLEAN)";
$db->exec($query);
//check insert 1
$values['checkboxitem'] = isset($values['checkboxitem']) ? true : false;
if (condition) {
INSERT INTO chckbxs (ischecked) VALUES (1);
}
//DELETE if uncheck
//READ database and make checked which database value is 1
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQLite</title>
</head>
<body>
<input type="checkbox" name="one" id="one">
<label for="one">One</label>
<input type="checkbox" name="two" id="two">
<label for="two">Two</label>
</body>
</html>
<?php
//Create a new SQLite3 Database
$db = new SQLite3('chckbxs.db');
//Create a new table to our database
$query = "CREATE TABLE IF NOT EXISTS chckbxs (ischecked BOOLEAN)";
$db->exec($query);
//check insert 1
$values['checkboxitem'] = isset($values['checkboxitem']) ? true : false;
if (condition) {
INSERT INTO chckbxs (ischecked) VALUES (1);
}
//DELETE if uncheck
//READ database and make checked which database value is 1
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQLite</title>
</head>
<body>
<input type="checkbox" name="one" id="one">
<label for="one">One</label>
<input type="checkbox" name="two" id="two">
<label for="two">Two</label>
</body>
</html>