You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
471 B
14 lines
471 B
const pool = require("../../server/db/connect");
|
|
|
|
const queryString = "SELECT * FROM stock WHERE status=1";
|
|
|
|
export default function handler(req, res) {
|
|
pool.getConnection(function(err, conn) {
|
|
// Do something with the connection
|
|
conn.query(queryString , function(err, rows, fields) {
|
|
res.status(200).json(rows);
|
|
});
|
|
// Don't forget to release the connection when finished!
|
|
pool.releaseConnection(conn);
|
|
})
|
|
} |