Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 database storage (SQL lite) - few questions
    primarykey
    data
    text
    <p>Hy there, </p> <p>I can't find enough beginner resources on the web about HTML5 database storage usage examples (CRUD)</p> <p>I'm opening(creating) my DB like this:</p> <pre><code>var db; $(document).ready(function() { try { if (!window.openDatabase) { alert('Not Supported -&gt; Please try with a WebKit Browser'); } else { var shortName = 'mydatab'; var version = '1.0'; var displayName = 'User Settings Database'; var maxSize = 3072*1024; // = 3MB in bytes 65536 db = openDatabase(shortName, version, displayName, maxSize); } } catch(e) { if (e == 2) { alert("Invalid database version."); } else { alert("Unknown error "+e+"."); }return; } }); </code></pre> <p>QUESTION 1: How many databases can i create and use on one domain? QUESTION 2. How to delete (drop) a database. -> i have not figured this out yet. </p> <p>To create sql queries you use transaction:</p> <pre><code>function nullDataHandler(transaction, results) { } function createTables(db) { db.transaction(function (transaction) { //first query causes the transaction to (intentionally) fail if the table exists. transaction.executeSql('CREATE TABLE people(id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL DEFAULT "John Doe", shirt TEXT NOT NULL DEFAULT "Purple");', [], nullDataHandler, errorHandler); }); } </code></pre> <p>QUESTION 3: How so is the above transaciton failed if a table exists? Is the nullDataHandler involved to do this? Where on the web is there documentation explaining the executeSql API? Arguments?</p> <p>thx</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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