#delete ssms SQL table row when radio button is checked on html using nodejs visual studio code

26 messages · Page 1 of 1 (latest)

cedar dove
#

people here aren't going to do your homework for you, especially when you've provided no context. provide context, show what you've tried, and ask a specific question.

elder cobalt
#

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

cedar dove
#

show what you've tried

elder cobalt
#

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

half lotusBOT
#

See #faq to learn how to properly share code on Discord: #faq message

elder cobalt
#

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

cedar dove
#

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

elder cobalt
#

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

elder cobalt
#

holy lol this might help

#

why I keep searching for delete in google it gives other stuff

#

even with control f