My current query looks like this:
router.get('/search?', function(req, res, next) {
var title = req.query.title;
var sql = "SELECT * from users WHERE title = ?";
connection.query(sql, [title], function (error, results, fields) {
res.json({"status": 200, "error": null, "response": results});
});
});
It works if I enter:
localhost:4001/api/v1/users/search?title=mr
But how can I search for multiple values with OR ... like this:
localhost:4001/api/v1/users/search?title=mr,mrs,dr