title: How to save the value of the checked checkbox to the database
body: <p>I have here checkboxes that have a different prices and each have a different titles. When the user clicks the checkbox, it will view the price in the total field. When the user now clicks the save button, I want now to save the total to the database and save the titles of the checked checkbox to categories. The titles that will be save to the one row of the database must be separated by comma (,).</p>
  
  <p>This is my HTML codes:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=utf-8 /&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" media="screen" href="css/master.css" /&gt;
      &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;!--&lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt;--&gt;
      &lt;!--[if IE]&gt;
      &lt;script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="" method="post"&gt;
          &lt;input type="checkbox" name="checkbox1" value="₱20"&gt; Red &lt;/br&gt;
          &lt;input type="checkbox" name="checkbox1" value="₱30"&gt; Blue &lt;/br&gt;
          &lt;input type="checkbox" name="checkbox1" value="₱40"&gt; Green &lt;/br&gt;
          &lt;/br&gt;&lt;/br&gt;
          Total: &lt;input type="text" name="total" readonly&gt;
          &lt;input type="submit" name="save" value="SAVE"&gt;
      &lt;/form&gt;
      &lt;script type="text/javascript"&gt;
      $(function(){
          //bind the change event to the checkboxes
          $('input[name="checkbox1"]').change(function(){
              var total = 0;
              //get value from each selected ckeck box
              $('input[name="checkbox1"]:checked').each(function(){
                  var tval = $(this).val();
                  //remove ₱ sign from value
                  //convert it to a flot
                  //plus it to the total
                  total += parseFloat(tval.replace("₱",""));                
              });
              //finally display the total with a ₱ sign
              $('input[name="total"]').val("₱ " + total);
          });
      });
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I don't have any idea in how to save the titles of the checkboxes to one row (CATEGORY) of the database. The total price must be save too in the TOTAL field in the database.</p>
  
  <p>Table name: PRODUCTS</p>
  
  <p>Columns: CATEGORY, TOTAL</p>
  
  <p>Example data saved in the database:</p>
  
  <p>CATEGORY:[Red, Blue]</p>
  
  <p>TOTAL: [50]</p>