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 6208821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:52:26+00:00 2026-05-24T05:52:26+00:00

I am developing an application for iPhone but I write JavaScript. I store some

  • 0

I am developing an application for iPhone but I write JavaScript. I store some information (the id and the name of an item) in the local database and now I need to get that information back so that I can use it. Unfortunately, the database returns to me undefined value but if I alert the value before the return statement, I get it correctly. My code is below:

function DB() {
    myDatabase.transaction(function (transaction) {
        transaction.executeSql("SELECT * FROM myTable WHERE id = ?", [idNum],

            function (transaction, resultSet) {
                var i = 0;
                var currentRow = resultSet.rows.item(i);
                return currentRow.name;
            },

            function (transaction, error) {
                alert('error:' + error.message);
            }
        );
    })
}

What am I doing wrong?

  • 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-05-24T05:52:26+00:00Added an answer on May 24, 2026 at 5:52 am

    The transaction method you are using does not return a value. Instead it passes it to a result function. Returning a result from the result function does nothing. You have to use the result of the query within the result function.

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

Sidebar

Related Questions

I'm developing an iPhone application and I need to send some information to an
I'm developing a iPhone application and until now not big problems. But today I
I am developing an iPhone application that persists data to a SQLite3 database. For
I've been developing GPL'd software for years, but now I need a more restrictive
I'm developing an iPhone application that uses the iPod library to play some songs.
I am developing an iPhone application where I need to provide an animation which
I am developing an iphone application which has some facebook integration in it.I added
I'm developing an iPhone application and i need to download and Save mp3 media
I am developing an iPhone application in which camera image store in NSData through
I am developing android version of an iPhone application. But, I found that in

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.