title: PhoneGap android database not working
body: <p>I'm having problems doing the Database example from PhoneGap. <a href="http://docs.phonegap.com/phonegap_storage_storage.md.html#openDatabase" rel="nofollow">http://docs.phonegap.com/phonegap_storage_storage.md.html#openDatabase</a></p>
  
  <p>The Problem is, when i run the example to openDatabase and populates he retrieves me the the Success Alert, but when i try to do the select one it gives me an error:</p>
  
  <pre><code>"Error processing SQL:0"
  </code></pre>
  
  <p>Is there any issue with databases and the android phone that i don't know? I've tried also in the android's emulator and i'm keep getting the same issue.</p>
  
  <p>Can you help me?</p>
  
  <p>Here is the javascript code:<br/></p>
  
  <p>Now i have the following code:</p>
  
  <pre><code>   document.addEventListener("deviceready", onDeviceReady, false);
  
  function populateDB(tx) {
      tx.executeSql('DROP TABLE IF EXISTS DEMO');
      tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
      tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
      tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
  }
  
  function errorCB(err) {
      alert("Error processing SQL: " + err.code);
  }
  
  function successCB() {
      alert("success!");
  }
  
  function queryDB(tx) {
      tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
  }
  
  function querySuccess(tx, results) {
      alert("i'm here =)");
  }
  
  function querySuccess(tx, results) {
      // this will be empty since no rows were inserted.
      console.log("Insert ID = " + results.insertId);
      // this will be 0 since it is a select statement
      console.log("Rows Affected = " + results.rowAffected);
      // the number of rows returned by the select statement
      console.log("Insert ID = " + results.rows.length);
  }
  
  function onDeviceReady() {
      $(document).ready(function() {
          $('#submit').click(function() {
              alert('clicked');
              var db = window.openDatabase("test", "1.0", "Test DB", 1000000);
              db.transaction(populateDB, errorCB, successCB);
              db.transaction(queryDB, errorCB);
          })
      });
  }
  </code></pre>
  
  <p>And still have the Succes alert when i do the populate transaction but the Alert of the queryDB has the Error processing SQL:0.</p>
  
  <p>Thanks in advance,<br/>Elkas<br/><br/>PS: I'm also using jQuery Mobile</p>