All Questions
Tagged with mysql javascript
17,630
questions
-2
votes
0
answers
33
views
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 16 of the JSON data [duplicate]
So, I'm new to PHP and SQL. I wanted to select the highscore of the user on the database and overwrite the highscore variable with it, so it doesn't start by 0 everytime I reload. I already managed to ...
-1
votes
0
answers
18
views
How to fix 'ER_FK_CANNOT_DROP_PARENT' error, 'ER_NO_SUCH_TABLE', 'ER_BAD_FIELD_ERROR' in Sequelize for MySQL? [duplicate]
When I run my server.js file I get the error mentioned in title.Also I get null violation errors when trying to insert into the TreeSeeds table. There is a foreign key called seedcompany_id in the ...
0
votes
1
answer
35
views
How to get Sequelize to recognize by primary key with MySQL database data set and fix bulkCreate() issue?
So I have a database where I am trying to establish a one-to-many relationship between Supplier and TreeSeed, whereby one Supplier can sell many TreeSeed. I have looked at the sequelize documentation ...
0
votes
1
answer
57
views
How to get Sequelize to recognize my custom foreign key and primary keys in a one-to-many relationship in MySQL during bulkcreate insert?
I am building a plant/arboretum style application in JavaScript. I am trying to create a one-to-many relationship between Supplier model and TreeSeed model. Meaning that one supplier can sell multiple ...
0
votes
1
answer
48
views
Avoid SQL injection in subquery [duplicate]
The following code adds a subquery to the values array that is used in an INSERT statement to the database. It's being used in a API utility class where the values from the request are passed as ...
1
vote
1
answer
48
views
Event Color based on Resource / Room Color - Fullcalendar.js PHP MySQL
I want to display the event color / background color based on each room's color (I have 3 different colors for 3 different rooms/resource). But the parsed colors from resources.php wasn't displayed as ...
0
votes
0
answers
25
views
await is only valid in async functions and the top level bodies of modules nodejs [duplicate]
Basically using Nodejs I connect to mysql and create a pool using below code which works fine,
db.js
const mysql = require("mysql")
exports.database = mysql.createPool({
host: "...
-1
votes
2
answers
88
views
MySQL insert query successful but not inserting into database table
I am working on a React/MySQL registration page. The insert query runs, but is not inserting into the database table. I am not sure why.
In the backend folder, I have my server.js file:
const ...
0
votes
2
answers
44
views
Sequlize filtering a table in a join table
I'm trying to filter products by their attributes that are in the linking table
Product => product_has_attribute => Attribute
I was only able to do OR, but I need to make a more precise filter.
...
0
votes
0
answers
23
views
How to Efficiently Handle Real-Time Forex Data Updates and Database Synchronization in Node.js?
I'm developing a Forex trading application using Node.js, where I need to handle real-time updates for around 600 currency pairs. The data comes from a FIX protocol engine and needs to be updated in ...
1
vote
2
answers
35
views
Update existing records without deleting fields in mysql
Here is my code
app.put("/update/:id", (req, res) => {
const userID = req.params.id;
const sql = "UPDATE quotes SET `first_name` = ?, `last_name` = ?, `company` = ?, `email` =...
0
votes
0
answers
34
views
Error connecting to the database: getaddrinfo ENOTFOUND when trying to connect to mysql container using node js
and I keep getting this error when trying to connect to my mysql image through in node.js project
Error connecting to the database: getaddrinfo ENOTFOUND 98b6c7aeb8af
I can access the container fine ...
1
vote
0
answers
40
views
How do I redirect user after succesful registration in NextJS 14? [duplicate]
Was trying to get familiar with nextJS 14.2.3
So I created a simple registration form, and tried to register a user. Sequelize appears to work fine, but I can't understand, how does the NextResponse....
1
vote
0
answers
25
views
Pm2 server is automatically turning off at any time on ssh of hostinger
0|blog-api | at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
0|blog-api | errno: -104,
0|blog-api | code: 'ECONNRESET',
0|blog-api | syscall: 'read',
0|blog-api | ...
1
vote
1
answer
48
views
Trouble adding new data to mysql database when using HTML form onsubmit to call a JavaScript function
I am trying to get the users Email address to add it to an existing mysql data base, previously I used this HTML and PHP code which works and does add the data to the database both on my server and ...