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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:22:25+00:00 2026-06-15T23:22:25+00:00

My first time attempt to update a field in record, but, its not saving

  • 0

My first time attempt to update a field in record, but, its not saving update when using a variable to specify the row.

Issue background – When the user clicks on an image, the checkDone() function is called, passing the row number (i). I then set a global variable (glbID) to the row nbr (i), and called the updateDB function to update the status field for the specified row. I never received an error, but, noticed the field was not updating. When I hardcoded the row id it saved the update. But, using the glbID var, as well as another strID to see if it was a format type issue, could not resolve the issue. Have tried several other variations to no avail.

Appreciate any one’s help on this. Am testing with Android emulator, let me know if any other info helpful for analysis.

function checkDone(i) {
   var db = window.openDatabase("Database", "1.0", "GTKdb", 200000);
   glbID = i    //SET global variable to row nbr
   document.getElementsByTagName("img")[i].src = "img/checkbox_checked.png";
   db.transaction(updateDB, errorCB); 
}


function updateDB(u) {        
   var strDone = "DONE"
    var strID = "" + glbID;  //SET new variable to glbID, converting to string to see if format type issue

    u.executeSql('UPDATE USER set status = ? where id = ?', [strDone,"2"], successCB, errorCB); //THIS WORKS WHEN ID value hardcoded
   //u.executeSql('UPDATE USER set status = ? where id = ?', [strDone,glbID], successCB, errorCB); //NO UPDATE using var glbID
   //u.executeSql('UPDATE USER set status = ? where id = ?', strDone,strID], successCB, errorCB); //NO UPDATE using var strID
    alert('AFTER UPDATE Status= '+status);  //No value for status appears
}
  • 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-15T23:22:26+00:00Added an answer on June 15, 2026 at 11:22 pm

    I’m not sure, but this might be the problem. when you are inserting string you need to give it inside quotes.

    'UPDATE USER set status = "?" where id = ?'
    

    hope it helps.

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

Sidebar

Related Questions

I am using -drawRect for the first time in an attempt to alternatively speed
first time posting here. I'm using a loop to create 3 buttons, but my
I'm am getting ready to attempt to implement Scripting Bridge for the first time,
First time I am using the persist() method in a project. With JPA I
I am using Doctrine and it fails to INSERT data the first time I
I have an odd issue. The first time a visitor comes to the site
As a long time reader of StackOverflow but not finding the solution to my
My domain model uses EntityFramework 4.1 (and I'm using code-first) to update my DB
OK, having tried my first TDD attempt, it's time to reflect a little and
first time post here. I was hoping someone could help me make custom SPARQL

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.