Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. router.get(`/tools/${table}`, (req, res) => {
  2. con.query(
  3. `SELECT * FROM ${req.params.table} WHERE particulars = '${checkValue}' `,
  4. (err, result) => {
  5. if (err)
  6. return res
  7. .status(400)
  8. .json({ connectionError: "Failed to connect with database" });
  9.  
  10. return res.json(result);
  11. }
  12. );
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement