i have a mysql table looking like this
id photo_name mob_no Status url
4 one 3434 OK http://foofo
5 two 434 Rejected http://barbar
6 three 434 Pending http://bazbaz
i'm printing it's values with ejs file but i would like to present 3 buttons which will allow to change the status to: Approve,Reject or pending lets say it'll return the query:
UPDATE `scans` SET `status` = 'OK' WHERE `id` = 6
unfortunately i couldn't find a way to use the post method and return these values only by clinking a button. iv'e tried to use form with a post method but it didn't worked, i also don't want to fill in a form with text, just press a button that basicly returns a string.
i'm printing the table like this:
app.get('/home/xray', user.xray)
exports.xray = function(req, res){
db.query('SELECT * FROM scans', function (err, result) {
if (err) {
throw err;
} else {
res.render('xray.ejs', {result});
}
});
};