Skip to content

Commit

Permalink
dbUpdateLinkList() bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemorken committed Jan 10, 2025
1 parent 56ebbae commit 522a3b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/alasql/anyTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ anyTable.prototype.dbUpdateLinkList = async function(options)
if (delval) {
let stmt = "UPDATE " + this.tableName + " " +
"SET parent_id=NULL " +
"WHERE " + id_key + "=" + delval + "";
"WHERE " + id_key + "=" + id + "";
//console.log("dbUpdateLinkList(4):"+stmt);
await alasql.promise(stmt);
}
Expand All @@ -1855,8 +1855,8 @@ anyTable.prototype.dbUpdateLinkList = async function(options)
for (const updval of inslist) {
if (updval && updval != id) {
let stmt = "UPDATE " + this.tableName + " " +
"SET parent_id=" + id + " " +
"WHERE " + id_key + "=" + updval + "";
"SET parent_id=" + updval + " " +
"WHERE " + id_key + "=" + id + "";
//console.log("dbUpdateLinkList(5):"+stmt);
await alasql.promise(stmt);
}
Expand Down

0 comments on commit 522a3b1

Please sign in to comment.