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.
you can use the [rotobtush](http://www.youtube.com/watch?v=xYgfDUnA1Ys) that allows to separate elements from a static background. Works better if:

* you have a clean background
* good quality videos
* front object needs to be cutted as big as possible