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

  • Home
  • SEARCH
  • 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 8336481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:00:16+00:00 2026-06-09T04:00:16+00:00

I have a test phonegap app to try sql database querying using Osx Lion,

  • 0

I have a test phonegap app to try sql database querying using Osx Lion, Xcode 4.3.3, phonegap 2.0, almost like in the docs

function populateDB(tx,user) {
 tx.executeSql('DROP TABLE IF EXISTS USER');
 tx.executeSql('CREATE TABLE IF NOT EXISTS USER (id unique, data text)');
 tx.executeSql('INSERT INTO USER (id, data) VALUES (1, "First row")');
}

function errorCB(err) {
 alert("Error processing SQL: "+err);
}

function successCB() {
 alert("success!");
}

function queryDB(tx) {
 tx.executeSql('SELECT * FROM USER', [], querySuccess, errorCB);
}

function querySuccess(tx,result) {
 if(results.rows.length==0) alert("No users");
 else alert(results.rows.length);
}

var db = window.openDatabase("user", "1.0", "user", 200000);

db.transaction(populateDB, errorCB, successCB);

db.transaction(queryDB, errorCB);

The second transaction is giving an error: “Error processing SQL:[object SQLerror]”

Any idea why?

  • 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-09T04:00:18+00:00Added an answer on June 9, 2026 at 4:00 am

    In you querySuccess- callback you have

    if(results)
    

    and in the function parameter it reads

    querySuccess(tx,result).
    

    After fixing that the code ran normally in Chrome’s console.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a test app on android using this cool-ass PhoneGap framework, but
I would like to test and distribute my phonegap app. It already runs for
I have a test sample about coherence lock-unlock mechanism like this: public class Test
I have a test project, with an App.config that sets up default values for
I have a PhoneGap app that I'm testing on webOS, Android, and iPhone. I'm
I have created a minimal PhoneGap app that has just this in the index.html:
I'm currently using phonegap to create and ios app. While getting familiar to the
I'm trying to test my phonegap app on my ipod touch 2nd gen. I
I'm developing a cross-platform PhoneGap app, and I'd like a string of text in
I'm diving into writing a mobile app with jQuery Mobile/PhoneGap. I'm using this sample

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.