Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9023577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:47:39+00:00 2026-06-16T05:47:39+00:00

Im trying out and copied code from here: http://luthfihariz.wordpress.com/2011/10/23/android-sqlite-phonegap-jquerymobile/ To succeed with a sample

  • 0

Im trying out and copied code from here:
http://luthfihariz.wordpress.com/2011/10/23/android-sqlite-phonegap-jquerymobile/
To succeed with a sample I’m working on just to learn this.
I have a link to my complete index.html on pastebin.

Please, correct me and also help me finding this errror.

Link to Pastebin here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:47:40+00:00Added an answer on June 16, 2026 at 5:47 am

    I didn’t have a lot of time, and it’s soon xmas 🙂 But.. 🙂 I did write you a working example with your code as a starter.

    Using Cordova version 2.2.0
    Using PhoneGap to compile
    I did test it on an android device
    I did change some things here and there, but I used the code frome here as a reference.

    document.addEventListener("deviceready", onDeviceReady, false);
    
    var db = "";
    
    function populateDB(tx) {
        tx.executeSql('DROP TABLE IF EXISTS SoccerPlayer');
        tx.executeSql('CREATE TABLE IF NOT EXISTS SoccerPlayer (Name TEXT NOT NULL, Club TEXT NOT NULL)');
        tx.executeSql('INSERT INTO SoccerPlayer(Name,Club) VALUES ("Alexandre Pato", "AC Milan")');
        tx.executeSql('INSERT INTO SoccerPlayer(Name,Club) VALUES ("Van Persie", "Arsenal")');
    }
    
    function queryDB(tx) {
        tx.executeSql('SELECT * FROM SoccerPlayer', [], querySuccess, errorCB);
    }
    
    
    function querySuccess(tx,result){
            var playerlist = document.getElementById("SoccerPlayerList");
            var players = "";
            alert("The show is on");
            var len = result.rows.length;
            for (var i=0; i<len; i++){
                alert(result.rows.item(i).Name + result.rows.item(i).Club);
                players = players + '<li><a href="#"><p class="record">'+result.rows.item(i).Name+'</p><p class="small">Club '+result.rows.item(i).Club+'</p></a></li>';
            }   
    
            playerlist.innerHTML = players;
            $("#SoccerPlayerList").listview("refresh");
    }
    
    
    function errorCB(err) {
        alert("Error processing SQL: "+err.code);
    }
    
    
    function successCB() {
        db.transaction(queryDB, errorCB);
    }
    
    
    function onDeviceReady() {
        db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
        db.transaction(populateDB, errorCB, successCB);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've downloaded (using repo) the Android 4.0 OS source code (from here - http://source.android.com/
I am trying out the following code inside a wordpress template: <?php //connect to
I am trying to figure out the code to delete all the rows after
I got a code from here to write a Int array to file. However,
I'm trying to write out a bit of code for the gradient descent algorithm
I'm trying out CakeEmail and I am having a problem. I added the code
Trying out the example usage of codebrew rails-backbone , everything works fine but the
Trying out the examples found on pleac.sf.net , I'm not able to get an
Im trying out the banking sample application and when i try to add or
While trying out an experimental UINavigationController-based iPhone application, I ran into a problem when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.