#Need help with sqlite3 module
18 messages · Page 1 of 1 (latest)
You don’t have named parameters in your SQL statement but pass them as an object for names parameters. Either pass them as array instead or use named parameters in the SQL
i tried with [name,data], {name,data} and ...,name,data,... also
all return same error
And did you check that the table in SQLite actually has those two columns?
i cant delete teh db rq to test
yeah
it for sure has it
You don’t need to delete it
wtf, it shows me it added it to the dn
*db
still error thrown tho
Does the error come from that line though?
hmm
/**
* @param {String} name
* @returns {Promise.<Command>}
*/
static async getCommand(name){
return new Promise(r=>{
db.all(`SELECT * FROM cmd WHERE name='?'`,[name],(err,rows)=>{
console.log("a2")
if(err)throw err;
r(rows[0])
})
})
}
its thrown in here?? lol
its coz of '', ok
it should be ? not '?'
ok, fixed