All Questions
173
questions
0
votes
0
answers
34
views
TypeError: connection.query is not a function - Issue when passing connection to another .js file
I've been developing a forum based application for a lab I'm creating however, I keep getting the following error when authenticating to the application (which uses. my authRoutes.js file):
TypeError: ...
0
votes
1
answer
39
views
Update module not works in Node.js
I made a blog using node and ejs, but my problem arises when I want to make an update of a post, the texts are updated without problem, but the attached image is lost even if it has not been edited.
I ...
0
votes
0
answers
15
views
Rendering same items with same ids across multiple pages
I am figuring out how to render my products across three different pages without adjusting their ids. Currently, the products only render on the home page but I want it on two other pages say About, ...
0
votes
1
answer
61
views
Viewing single product details
I am building an e-commerce project, and at the point where I want the user to be able to view the details of a product once they click on a "view" button. I have already rendered the ...
0
votes
1
answer
69
views
Live update results from database wih every charachter the user types in the search bar
I want to live update a table f results based on the charachters the user type in the search-bar
This is my search.ejs
<div class="search">
<form action="/search" ...
0
votes
0
answers
36
views
Format data data coming from MYSQL
const Fornecedor = require("../model/Fornecedor")
const Aluguel = require("../model/Aluguel")
router.get('/admin/rent',(req,res)=\>{
Aluguel.findAll().then((alugueis)=\>{
...
0
votes
0
answers
160
views
How to display data from Mysql to EJS template with WHERE clause? such as ID
how can i display the data from Node JS and Mysql db to EJS template with WHERE clause such as id, username or email.
i try this code from Node server.js with hard coded id no. 2 and i want to display ...
1
vote
1
answer
757
views
Unknown column 'id' in 'where clause'
I have a problem in these line of codes i think
app.post('/delete/:id',(req,res)=>{
db.execute(`DELETE FROM 'tabel' WHERE id = ${req.params.id}`)
res.redirect('/')
})
when i try to delete ...
0
votes
2
answers
40
views
How can I use MySql tables in my view using EJS? I cannot identify what is wrong
When I try to use the data in my EJS page it gives this error:
TypeError: C:\Users\ygor\Documents\VS Code\Digital House\PI-DevNap\src\views\user.ejs:22
20| <a class='photo' href=...
1
vote
1
answer
36
views
Express router Error: No default engine was specified and no extension was provided
I'm trying to create a login page and when i go localhost:5000 i see this error
Error: No default engine was specified and no extension was provided.
at new View (C:\docs\diplom\master3\node_modules\...
0
votes
1
answer
378
views
How to correctly use a Select (*) count in Nodejs(EJS)?
At this moment, in part of the code, I want to display the result of the number of records in a table, but I get an error message
[Object Object]
I have seen some similar questions but they have not ...
0
votes
1
answer
90
views
How to make a GET (app.get) take two tables or allow me to do more functions
I need some help
I have a final project for university and I have decided to do it with
NodeJS
EJS
MySQL
But I have not been able to solve this error that I know it may sound stupid but I am new to ...
0
votes
1
answer
150
views
How to display an array of object in ejs with conditions
i'm doing a web app to manage my money with node Js.
Here is what it's look like :
I've done almost everything, but I still have one part to do, which is to display my last 30 transactions.
I can't ...
0
votes
0
answers
212
views
Variable showing as undefined in node.js with mysql
I'm using node.js and mysql for the database. All of my webpages are in .ejs. I have 1 page for customer reviews, I have a form to POST data to my database and then show data from the database as well ...
0
votes
1
answer
113
views
Show/Hide the login and logout buttons
I'm currently using MySQL and EJS. I was trying to show/hide buttons based on user authentication, but it didn't work.
connection.js
const mysql = require('mysql');
const util = require('util');
...