when trying to run this statement in Node
app.post('/newpost', (req, res)=>{
db.serialize(async()=>{
await db.run(`
insert into posts (title, desc, md)
values (${req.body.title}, ${req.body.desc}, ${req.body.body});
`)
await res.sendStatus(200).end()
})
})
The following error appears
[Error: SQLITE_ERROR: near "<": syntax error
Emitted 'error' event on Statement instance at:
] {
errno: 1,
code: 'SQLITE_ERROR'
}
I am trying to simply post data from a form into a db table, but it seems to think that the table doesn't exist or something
The table structure is
id INTEGER PRIMARY KEY AUTOINCREMENT,
title VARCHAR(255) NOT NULL,
desc TEXT NOT NULL,
md TEXT NOT NULL