title: Insert the data in phonegap database table?
body: <p>In my application, i want to insert the value in the table. i have created the databse in <strong>onDeviceReady()</strong> method in the <strong>index.html</strong> file.</p>
  
  <pre><code>     &lt;!DOCTYPE html&gt;
  &lt;!-- Auto Generated with Sencha Architect --&gt;
  &lt;!-- Modifications to this file will be overwritten. --&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="generator" content="HTML Tidy, see www.w3.org"&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  &lt;title&gt;Teritree&lt;/title&gt;
  &lt;script type="text/javascript" id="phonegap" src=
  "cordova-2.0.0.js"&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript" src="barcodescanner.js"&gt;
  &lt;/script&gt;
  
  &lt;script src="sencha-touch-all.js" type="text/javascript"&gt;
  &lt;/script&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="app.css"&gt;
  &lt;script type="text/javascript" src="app/Ext.ux.touch.Rating.js"&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript" src="app/app.js"&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
          Ext.Loader.setConfig({ disableCaching: false });
          Ext.Ajax.setDisableCaching(false);    
  
  &lt;/script&gt;
  
  &lt;script type="text/javascript" charset="utf-8"&gt;
  
      var pictureSource;   // picture source
      var destinationType; // sets the format of returned value 
      var mydb;
  
      // Wait for PhoneGap to connect with the device
      function onLoad() {
          document.addEventListener("deviceready",onDeviceReady,false);
      }
  
      // PhoneGap is ready to be used!
  
      function onDeviceReady() {
          console.log("it is in ondevice ready method..");
          mydb = window.openDatabase("teritreeDb", "1.0", "TestDB", 10000);
          console.log("it is in ondevice ready method..1");
          mydb.transaction(populateDB, errorCB, successCB);
          console.log("it is in ondevice ready method..2");
     }
  
     function populateDB(tx) {
     console.log("it is in populateDB----------1");
       tx.executeSql('DROP TABLE IF EXISTS DEMO', function () {
           tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)', function () {
               console.log("Table created");
           });
       });
  
        // Transaction error callback
      //
      function errorCB(tx, err) {
          alert("Error processing SQL: "+err);
      }
  
      // Transaction success callback
      //
      function successCB() {
          alert("success!");
      }
  }
  
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
          if (!Ext.browser.is.WebKit) {
              alert("The current browser is unsupported.\n\nSupported browsers:\n" +
                  "Google Chrome\n" +
                  "Apple Safari\n" +
                  "Mobile Safari (iOS)\n" +
                  "Android Browser\n" +
                  "BlackBerry Browser"
              );
          }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now i have one signup screen and there in the signup screen i have submit button. So if i click the submit button, all the details should store in the database means in the DEMO table..So in the controller, i am writing the button event,</p>
  
  <pre><code>     onSubmitButtonTap : function(button, e, options) {
  
          mydb = window.openDatabase("appDb", "1.0", "Test DB", 1000000);
          mydb.transaction(storeCustomerDetails, error, success);
  
  
      function storeCustomerDetails(tx)
      {
          tx.executeSql('insert into DEMO (id,data) values("1","Hello")');
          tx.executeSql('insert into DEMO (id,data) values("2","Hello World")');
      }
  
      function error(){
          alert("data is not inserted");
      }
      function success(){
          alert("data is succesfully inserted");
      }
  },
  </code></pre>
  
  <p>but it is giving me the alert, data is not inserted.
  I followed the link: <a href="http://docs.phonegap.com/en/1.0.0/phonegap_storage_storage.md.html#openDatabase" rel="nofollow">Phonegap DB Link</a></p>
  
  <p>Please help..</p>