Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@clint:- Please, read this <a href="http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html" rel="nofollow">URL</a></p> <p>or Try this Example this is really working</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Contact Example&lt;/title&gt; &lt;script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; // Wait for PhoneGap to load // document.addEventListener("deviceready", onDeviceReady, false); // Populate the database // 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")'); } // Query the database // function queryDB(tx) { tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB); } // Query the success callback // function querySuccess(tx, results) { var len = results.rows.length; console.log("DEMO table: " + len + " rows found."); for (var i=0; i&lt;len; i++){ console.log("Row = " + i + " ID = " + results.rows.item(i).id + " Data = " + results.rows.item(i).data); } } // Transaction error callback // function errorCB(err) { console.log("Error processing SQL: "+err.code); } // Transaction success callback // function successCB() { var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000); db.transaction(queryDB, errorCB); } // PhoneGap is ready // function onDeviceReady() { var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000); db.transaction(populateDB, errorCB, successCB); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Example&lt;/h1&gt; &lt;p&gt;Database&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload