Question: I am trying to accomplish live checkbox result with checked/unchecked checkbox. My logic for checkbox works but now I want to store this live checkbox result in MYSQL. So when I click on checkbox, result should be stored in database same as when I uncheck checkbox result should be stored in database. I don't want to use any button in this example.

Here is my code:

```
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" >
    function writeTo(object) {
      var container = document.getElementById("container");
      if (object.checked) {
         container.innerHTML =  "Added " + object.value + " <br />";
         } else {
        container.innerHTML =  "Removed " + object.value + " <br />";

      }
    }
</script>
</head>
<body>

    <div id="container"></div>
    <input type="checkbox" onclick="return writeTo(this)" name="check_list" value="Appel">Apple<br>
    <input type="checkbox" onclick="return writeTo(this)" name="check_list" value="Grape">Grape<br>
    <input type="checkbox" onclick="return writeTo(this)" name="check_list" value="Orange">Orange<br>
    <?php
   echo $dd= "<script>document.writeln(container.innerHTML);</script>";

require 'Database.php';

echo $sql="Update scott123.rahul_tbl_users set group1='$dd' where Dingoid=70001501";
//$sql1=mysql_query($sql);
     ?>

</body>
</html>

```

Answer: 
This works with a technique called difference matting. It never works well even if you have a solid clean plate. your best bet is to rotobrush or just mask them out manually. if you want to try difference matting you can set the footage layer with the people in it to difference blending mode and put a clean plate below it.
It is not impossible, but I don't think it could give you the best result.
Anyway, you should mask them out manually. but not keyframe by keyframe. there is a technic for it. for setting the mask keyframes, first, you should set 3 keyframes in first, middle and end of your footage.
after masking three one, you do it the same for first keyframe and the middle one.
it means between the first keyframe and the middle keyframe, you should set a key.
Do the same for middle and end key.
this technic could save your time and make masking with less fault.
by the way, you can use [Mocha pro](https://borisfx.com/products/mocha/) as well for tracking the persons.