http://inwebsite.wordpress.com say: waw! thank's
first this code not work. Then,
I read this code per line, i found that sentence comment when i copy paste was entered so i put it back then tara... it works

Very nice post, It will be very useful. Otherwise, I have no clear where the database that is created by phonegap is stored? The database is stored at device File System or at memory?

Reading all comments I have notice that Phonegap have problems with using sqlitedb under Windows 8. Is this true? Our customer need an a mobile app that runs on different platforms (Android, Windows 8 and iOS) but it seems phonegap does not cover access to the database for all these platforms.

Works perfectly! Thank you so much!!! Been looking for a simple tutorial on using SQL inside a PhoneGap app. This is exactly what I needed.

To anyone who wants to use this code -- a word of warning:
The way the text is formatted on this page, some of the text is being word-wrapped to the next line. You have to put it into a text-editor and fix the bad line-breaks in the comments so they don't interfere with the code. (Lines 105/106, 113/114, 121/122 are an example of this, although there are several more.)

There are also a couple of bad line-breaks in the JavaScript code itself. For example, lines 130, 131, and 132 should all be on a single line with no line-breaks. Lines 70/71 have the same problem. There are several other examples of this problem as well.

So, because of the way the text is formatted on this site, you can't simply copy/paste and expect it to run. Take your time and go through it to fix all the weird line-breaks, and I promise you it will run. (Oh, also don't forget to download the proper jQuery-min.js file at jQuery.com. Then it will run. I promise.) :-)

Works great! thank you! the only thing is that when you paste it from here make sure you check all lines once to see if the comments are fine and there are not additional enters. just fix them and it works great!

WebSQL

At least an example of database usage in phonegap that works!!! You need to change the file from js to html and look for comments that aren't commented, but after cleaning this, it works without configuring or typing any code.

Does not seem to be working for me, throwing the error in alert box: Error could not prepare statement(1 no such table:User)code:5. I have copy pasted the same code given above and inserted required '.js' files. I am working on windows machine with phonegap installed on it.

Got it to work with little effort!!! @atul789, I actually saw the same error you did the first go and it was because I missed one of the errant line breaks in one of the comments in the onBodyLoad function. After I fixed that, it added the User table as designed. I would look back over your code for any improper line breaks if you haven't already.

Thanks so much for this example! I never realized so much potential was available using html5 app development and now I'm really excited to get started.

Finally after a week of aggravation i got this to work lol. For anyone still puzzled, you need to reformat a lot of the javascript, comment some lines out, etc. Also, make sure you download and include jquery-3.1.0.min.js and jquery-3.1.0.js in your project folder and reference them in the index.html file.

Now i have a question. I changed the <span> tag to a <ul> tag with the same id and it works, displaying as a numberd list. Cool. How can I have the entries in the <ul> be links that I can click on to show that specific entry? In my form, i'm catpuring more than 2 field entries, but only want to show 1 field value in the list, then when the user clicks on that specific entry, it shows the whole entry (I hope that makes sense).

For example, user enters name, address and phone number, all entries get inserted into table but the <ul> would only show the name. then user clicks on a name and it will show the whole entry (name, address, phone) Anyone have any ideas? Thanks in advance :)

In my cordova 6.3x, it wasn't working and I was intrigued once it was working in both safari and chrome. So I read the other day about how the onClick= method was unstable, and I remove them from the inputs and wrapped all the inputs in a single form with a POST method and a submit button. Voi lá! Great code, thanks man, really appreciate.