Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/product', getProductPage);
- getProductPage: (req,res) => {
- let query = "SELECT p.*,i.* FROM `product` AS p INNER JOIN `productimage` AS i ON p.productId = i.productId ";
- getConnection().query(query , (err, result) => {
- if (err) {
- return res.status(500).send(err);
- }else {
- console.log(result);
- res.render('product.ejs',{
- product:result
- });
- }
- })
- <% product.forEach((product) =>{ %>
- <tr>
- <td> <img id="productImage" src="data:image/png;base64,.base64_encode(<%= product.productId %>)"></td>
- <td ><%= product.productName %></td>
- <td><%= product.price %></td>
- <td><a href="/editProduct/<%= product.productId %>" id="edit" id="edit"> Edit</a></td>
- </tr>
- <% }) %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement