#delete ssms SQL table row when radio button is checked on html using nodejs visual studio code
26 messages · Page 1 of 1 (latest)
however, if I have 10 items and delete 3 items on the HTML page with localhost, then refresh, it goes back to 10 items
I'm trying to make it save with the database
I wasted more than 7 hours on this when people probably managed to do this in less than 4 hours
show what you've tried
I have 2 js files server.js and script.js. I got an app.delete route in server.js where I'm trying to call to delete rows on SQL database table
it calls a function in the script.js file
but I think I might not put the correct vocablary on the server.js
See #faq to learn how to properly share code on Discord: #faq message
i got something like const [id_items] = await db('items').where().delete
res.status(204).json({id_items}) but i dont understand any of that
then catch (error)
it worked with
const [id_items] = await db('items).insert({item_name, price, quantity, giver, date}]
so thats what i wanna know, im trying to delete instead
idk the vocabulary
what sql library are you using? pretty sure somebody already asked you that... also, if you have an empty argument list for .where(), it's obviously not going to work
yeah exactly I tried putting id_items in it but idk how it works
I'm using sqlite3, knex 0.95.15 and express
I know how it works IN SQL SSMS but not in nodejs