saran
data Anda yang dimasukkan ke dalam database tidak ada di objek req.body, melainkan di tempat lain. seperti req.files.file
obyek. Anda dapat mencetak log dengan menggunakan console.log('req.file' + req.file + 'req.files' + req.files) di file app.js Anda
app.post('/save',upload.single('featured_img'), function (req, res) {
console.log('req.file' + req.file + 'req.files' + req.files)
let sql = "INSERT INTO `music`(`featured_img`, `title`, `band_name`, `audio`) VALUES ('" + req.body.featured_img + "', '"+req.body.title+"', '"+req.body.band_name+"', '"+req.body.audio+"')";
let query = connection.query(sql, (err, results) => {
if(err) throw err;
res.redirect('/');
});
});