{"id":6059,"date":"2014-04-12T02:58:23","date_gmt":"2014-04-12T02:58:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/update-database-in-phonegap-collection-of-common-programming-errors-2\/"},"modified":"2014-04-12T02:58:23","modified_gmt":"2014-04-12T02:58:23","slug":"update-database-in-phonegap-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/12\/update-database-in-phonegap-collection-of-common-programming-errors-2\/","title":{"rendered":"update database in phonegap-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m getting the following error:<\/p>\n<blockquote>\n<p>Uncaught Error: INVALID_STATE_ERR: DOM Exception 11<\/p>\n<\/blockquote>\n<p>I get this error message when trying to execute a query.<\/p>\n<p>Did anyone ever get the same problem ?<\/p>\n<pre><code>function populateDB(tx) {\n\n    tx.executeSql('DROP TABLE IF EXISTS ORDERS');\n    tx.executeSql('CREATE TABLE IF NOT EXISTS ORDERS (id INTEGER PRIMARY KEY, client_ID, status)');\n\n    var myurl=\"xml.xml\";\n    $.ajax({\n        type: \"POST\", \n        url: myurl, \n        dataType: \"xml\", \n        success: onSuccess\n    }); \n}\n\nfunction onSuccess(xml) {\n\n    $(xml).find('articles').each(function () {\n        var idord = $(this).attr('id');\n\n        var esql ='INSERT INTO ORDERS (id, client_ID, status) VALUES ('+idord+', 4, \"done\" )';\n        var nameclient = $(this).find('name').text();\n        $('.items').append('<\/code><\/pre>\n<h2><code>'+ nameclient '<\/code><\/h2>\n<pre>').appendTo('#xml-data'); \n\n        tx.executeSql(esql) ;\n    });  \n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m getting the following error: Uncaught Error: INVALID_STATE_ERR: DOM Exception 11 I get this error message when trying to execute a query. Did anyone ever get the same problem ? function populateDB(tx) { tx.executeSql(&#8216;DROP TABLE IF EXISTS ORDERS&#8217;); tx.executeSql(&#8216;CREATE TABLE IF NOT EXISTS ORDERS (id INTEGER PRIMARY KEY, client_ID, status)&#8217;); var myurl=&#8221;xml.xml&#8221;; $.ajax({ type: &#8220;POST&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6059","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6059"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6059\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}