Fix exception when erasing items and switch to bound parameter

This commit is contained in:
Dan Stillman 2006-06-02 07:11:54 +00:00
parent daa1a6e8a5
commit bebf0f223a

View File

@ -667,12 +667,12 @@ Scholar.Item.prototype.erase = function(){
Scholar.Collections.get(parentCollectionIDs[i]).removeItem(this.getID()); Scholar.Collections.get(parentCollectionIDs[i]).removeItem(this.getID());
} }
sql += 'DELETE FROM itemCreators WHERE itemID=' + this.getID() + ";\n"; sql = "DELETE FROM itemCreators WHERE itemID=?1;\n";
sql += 'DELETE FROM itemKeywords WHERE itemID=' + this.getID() + ";\n"; sql += "DELETE FROM itemKeywords WHERE itemID=?1;\n";
sql += 'DELETE FROM itemData WHERE itemID=' + this.getID() + ";\n"; sql += "DELETE FROM itemData WHERE itemID=?1;\n";
sql += 'DELETE FROM items WHERE itemID=' + this.getID() + ";\n"; sql += "DELETE FROM items WHERE itemID=?1;";
Scholar.DB.query(sql); Scholar.DB.query(sql, [{'int':this.getID()}]);
Scholar.Creators.purge(); Scholar.Creators.purge();
try { try {