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.
 
 
 

18 lines
626 B

// Загрузка списка пиццы
const pool = require("../../../server/db/connect");
const queryString = "SELECT * FROM products WHERE status=1 and id=?";
export default function handler(req, res) {
//const data = req.body;
const { pid } = req.query
pool.getConnection(function(err, conn) {
// Do something with the connection
conn.query(queryString, [pid], function(err, rows, fields) {
res.status(200).json(rows);
console.log(rows);
});
// Don't forget to release the connection when finished!
pool.releaseConnection(conn);
})
}