Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Update database not working

Open
#198 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, sqlite
Domain
databases

Research direction

No repository file or test is named. Start by reproducing the JavaScript snippet through the SQL.Database entry point, then inspect how prepare(), bind(), and update execution are documented or exercised; done means confirming why the row remains unchanged and verifying that the update persists.

Written by the indexing model from the issue text.

Description

I try:

xhr.onload = function(e) {
          var uInt8Array = new Uint8Array(this.response);
          var db = new SQL.Database(uInt8Array);
          var contents = db.exec("SELECT * FROM drugs WHERE id="+idDrug+"");

          var viewed = parseInt(contents[0]['values'][0][6])+1;
          
          var stmt = db.prepare("update drugs set viewed=? where id=?");
          stmt.bind([viewed, idDrug]);
}

But row not update, please help me.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sql-js/sql.js

All issues in sql-js/sql.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.