This is exactly what I've been looking for. It's more than 2 years old, but still answered some questions I had. Very well explained, easy to follow and extremely useful and educational.
Theres a lot to learn from this. Thank you so much. Finally I know how to use a database with javascript. What I need to know how is making profiles so that the database has it's use so that unique users of a website have slightly different experience
wow! i've bought a bunch of udemy courses and watched trillions of tutorials. this is the first time i really felt like i've learned something that takes me one step further to being a developer
Thanks again for this tutorial! If you are getting this error: "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client db disconnected", then try to change the USER in .env file to USERS and also change USER in connection in dbService to USERS. This will resolve the problem. This problem is caused as there seems to be an inbuilt variable USER in env so when a connection was made, instead of getting the specific username, the deafult USER value was used that caused this error.
I guess you are wrong The main reason why this error occurs is because when we make a new user in mysql ,it uses caching_sha2_password plugin for user authentication by default. We can check the authentication plugin for users using the command: SELECT user,plugin,host FROM mysql.user;It will show u a table like this. +------------------+-----------------------+-----------+ | user | plugin | host | +------------------+-----------------------+-----------+ | mysql.infoschema | caching_sha2_password | localhost | | mysql.session | caching_sha2_password | localhost | | mysql.sys | caching_sha2_password | localhost | | root | caching_sha2_password | localhost | | tutorial | mysql_native_password | localhost | | web_app | caching_sha2_password | localhost | +------------------+-----------------------+-----------+ According to mysql docs : The caching_sha2_password and sha256_password authentication plugins provide more secure password encryption than the mysql_native_password plugin, and caching_sha2_password provides better performance than sha256_password. Due to these superior security and performance characteristics of caching_sha2_password, it is as of MySQL 8.0 the preferred authentication plugin, and is also the default authentication plugin rather than mysql_native_password. This change affects both the server and the libmysqlclient client library: So if you have already created a user and you want to change the plugin from caching_sha2_password to mysql_native_password write the following command: ALTER USER myuser IDENTIFIED WITH mysql_native_password BY 'mypassword'; replacing myuser with username and mypassword with the password for the repective username. Another thing that you could do is to create a new user with plugin mysql_native_password. To do that you could use the following: CREATE USER 'your_user'@'your_server_ip ' IDENTIFIED WITH mysql_native_password BY 'your_password';
Thank you so much. It's nice to be able to put something together from start to finish. It's so helpful to actually connect to a database. This should be a springboard to bigger and better.
Yo thanks for this tutorial, the internet desperately needs more node mysql tutorials of quality like this one. Mongodb, even though I like it, seems overhyped.
If you have any trouble with nodemon saying "nodemon: command not found", I found this Stack Overflow answer which helped me... ``` npx nodemon [your-app.js] ``` With a local installation, nodemon will not be available in your system path. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`.
Loved this tutorial. Still the best out there for node js with mysql. I was able to modify this to add football players and stats to a data base and filter across any stat. Now I have it working great I just a little stuck on how to deploy It so my group of 20 friends can access it without a monthly fee for hosting the database. Any thoughts or videos on self hosting this app?
Thanks for the tutorial, question if I may in the insertNewName function you have resolve(result.insertId); What is .insertId please? is this a class variable from the result in connection query? Im asking because I dont set that myself anywehere. is resolve(result.affectedRows); the same as well? Thanks
thank you for video!!! tutorial so cool !!!! it will be great if someday you make tutorial about authorization in nodeJS with mysql !!! Thanks a lot !!!!!!!
Thanks for this course... should've found it months ago. I'm having trouble with mysql and mysql2 imports and exports. Is there somewhere I could get the complete finished code?
Just discovered your channel, your tutorials are awesome! Would you consider making email registration and login for this system to fully round out the app? Thanks for your time and knowledge.
Awesome bro..this type tutorial i prefer..backend and front explain..simple to understand!!keep it up bro.. and i got question..can we connect from multiple db in 1 server and how to declare it.
I'm glad you liked it! Yeah we can definitely connect to more than 1 db in the server. I know I always set the db in my config. One way you can connect to multiple dbs is have multiple connection files specific to what db want you want to connect to.
@@NsquaredCoding example i have 2 app..one using wordpress and codigniter.i need my user can access both in 1 user acc.how to make auth global.if posible guide with login/registration too...hehehe..thanks
Thank you for the video. Although I do have problem and that is that I can't display or console.log the insertId. It returns as undefined. Yet in xampp I can view it.
This is very helpful but my dbService also got disconnected but mine didnt tell me anything about passwords and stuff like that just in the terminal it said dbdisconnected
I want to know that how can you show the data of the row you are editing in edit row input meaning i want that when i click on edit button the value of that row should be filled in the input
This is probably a silly question, but i'm a newbie. What languages (i.e. Javascript) would I need to learn to full understand the programming concepts/syntax behind this video?
No silly questions! I'm happy to help. Mostly JavaScript for the client side in the browser and then in the backend as well for using the Node runtime. Then there is MySQL which is a query language for the database. For the web page you'll need to know HTML to build the table and CSS to style your HTML like changing the color for example.
Hey man, thanks for this cool project. I was wondering if no data found in the search input, it should say "No Data Found" but in the tutorial you didn't implement that. I coulnd't figure out the implementation.
Thank you! To refresh the data without reloading the page we need to rebuild the table each time in javascript and then render it to the dom. Let me know if that helps or you want to know more about the implementation.
@@NsquaredCoding I just enclosed the fetch inside a function called 'showTable' and every time i add data i call this function and it updates the table without reloading the page
Hi, nice tutorial it helps me a lot. I have a smal problem. So in the tabel on my webseit the name is showd but the id and Date will be showd with undefind. I do not realy now the problem. If I want to parse the Date it says invalid Date. I hope some one can help me. Thx
Hi, thanks for your explanation.. i am confused that how nodejs and apache webserver runs on the same server? Does it affect performance? Is it possible to deploy nodejs and mysql without apache?
Thank you! I want to convert server api from .Net to ExpressJs and then I found this video. In .Net we get data from data base with EntityFramwork(use LINQ) and in JS we get data with query sql, right? And I want to know how to create database in code, migration data base, (add new table, edit(delete, add column) table). Can you make a video for that? Thank a lot!
Could you build the same api using MySql Workbench, and also conduct all back-end and front-end functionalities in one js file? Its a little confusing .env file as I haven't used that in my last task where I created a dynamic webpage using mongodb. Was just wondering as I wanted to do it easier way. Thanks.
Once you add a new record to the database you don't need to recreate the function to load data into the table .... you already have that function (loadHTMLTable) and you can just call it again.
I wish there's a shortcut to refresh the page instead adding code between 52:06 -1:00:48. Now I see why people choose React or Vue instead of plain HTML with javascript. In React, all you need is useEffect() to refresh. Anyway, 52:48 I don't know how MySql INSERT statement return id. Does it return inserted id by default? Also, anyone can explain this: data['data'] what does it mean? Where is '.no-data' in index.html?
You're right, a client side framework definitely has its advantages in these cases. Yes you will get an insert id back when you execute an insert operation. Data is an object and inside that object there is a key that is also called data. We are accessing that key inside the data object. I believe .no-data is being inserted dynamically from Javascript. I'll need to look at the code to double check.
@@NsquaredCoding Thank you so much. Sorry for causing confusion. '.no-data' is in loadingHTMLtable function. I was focusing too much on Insert function that I forgot 'no-data' is dynamic table.
Hi NSquared Coding, when I run 'nodemon app,' it's saying the command isn't found. I've done npm install 'nodemon --save-dev' Do you know why this isn't working?
I installed it like this 'npm install --save nodemon" and my package.json is like this: "name": "server", "version": "1.0.0", "description": "", "main": "server.js", "scripts": { "start": "nodemon index.js", "devStart": "nodemon index.js", "test": "echo \"Error: no test specified\" && exit 1" make you're in 'server' folder to run command 'npm start'
It is a very good tutorial! I have some issues. can you help me? I dont know why but document.querySelector('table tbody') dont work 10:15 but if i use document.getElementById('tablebody') and add id to table body it works... how to solve this?
@@NsquaredCoding Thank you so much for your quick response! Yeah, that solved my problem. But I still need to specify otherwise document.querySelector ('# table-Body') doesn't work. I don't understand, because for you and everyone here have everything working as it should, no one has any questions on this. It is difficult to study JS when faced with a similar misunderstanding of the problem
Hey dude, i'm following this tutorial you brought. I trying add three data column attributes for table from my database i've created, example I created ("name", "address", "no. Telp") into table. Then, can you tell me how fetch those three data column into table to view in website is working? Btw, love you videos.
@@NsquaredCoding yeah, i added it. And it worked after i used to create "insert" and "delete" query for table, except i have problem those "update" for editing data I want and can't change those three attribute, and I got some error because it's from relationship between function from index and app , and it's said "Uncaught (in Promise) Syntax Error: JSON.parse: unexpected character... " and "XHR Patch 404... " In console my log. Can you tell me hint how to fix it?
Sir, please tell me how did you changed in privileges as username and other things at 27:28 . I am really facing issue in my code. I am getting same error which you got early Please help🙏
For some reason, when I try to add a new user to give privileges to the database, the checkbox: "Grant all privileges on database web_app" is missing. The first two checkboxes are there, but not the one I actually need checked. Because of that, the app will not connect unless I change the username of the new account in phpMyAdmin to my actual local username in my computer. Otherwise, if I change the name to 'tutorial', it won't work. Any help would be appreciated. Thanks!
On update I've got this error " uncaught ( in promise) TypeError: Failed to fetch" have worked with headers: { 'Content- type': 'application/json' } & still not working. why?
On beginning of the video when you present demo of this application on first udpate is not refreshing the page but on second update action is refreshing the page, what is the difference?
Hmm I saw that, it might have happened really fast. In this project it should refresh the page when clicking on update. There should be no difference. I hope that clears up any confusion.
Hi i wanna ask smth tht around 27:40s u changed the user name and i did too and i got this error [ ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client ]. Can u answer to my question? and i use mysql-workbench not xxamp if this can make problem?
u have changed user name indirectly . how do we know what are the changes required correct the connection request. iam new to this language. iam following a this videos .actually its awsm . But iam stucked in that connection part. how can i clear that
at around 41:30 i start to get "ReferenceError: require is not defined" also and probably unrelated the whole time through the app sometimes runs and sometimes complains that "listen EADDRINUSE: address already in use :::5000"
Thanks for a great tutorial. But I can't get the connection to the database to work ! I also get: ER_ACCESS_DENIED_ERROR How can I fix it. For me it seems that the file .env is not working. Can anyone help me??
Thank you for this one! Can u tell us , how to deploy the client side to a host( netlify for example) and talk to our server (node.js). I mean, i want to visit the website on my phone, and to send some data to the server, so i can store them in MySQL. Is is possible?
Timestamp: 34:30 - Address (Port) Already in Use. I am receiving this error message when trying to run the first SELECT. It is reporting that the database port is already in use. The DB Server is serving other applications - the application should not be reporting this - correct? I know that I can use a mysql pool to respond to db requests - can you share how the code would change by using a Pool instead of connection?
In 29:08 in the code "return instance? instance: new dbservice" won't the instance always be null since there appears to be no code that changes it to not null if new dbservice object is created?
Hi, could you help me with a situation i was running nodemon app but i got the problem "[nodemon] app crashed - waiting for file changes before starting..." may you have idea how to fix this?
There must be an error in one of your files which may be crashing it. Try to stop the server and then restart it if you believe there aren't any errors.
That will start your backend server. You need to creat an html file with a JavaScript file that will be included in your html file. Open the html file in your browser and you should be good to go.
In timestamp around 18:58 servers runs and shows "test". But in inspect it is showing [Uncaught ReferenceError: require is not defined] I am new to node js and i am not able to rectify it.
Hello great tutorial and all but at the update part the section where you added the header on the fetch of updatebtn. When I followed it I’m only getting the name and not the id of updateNameInput. How to fix this :(
Hi Nsquare; I still didnt understand this part of tutorial: static getDbServiceInstance() { return instance ? instance : new DbService(); Since you already declare the instance = null.. Wouldn't the results will always will be null.. And I still cannot understand of this part , on what exactly is the purpose of getDbServiceInstance()..? Btw.. great tutorial .. thankYou
Thank you! That is to make sure we are only getting one instance of the db class. If we are making multiple queries and are using this class there is no need to make multiple instances of this class. It will return the original instance that was created. I hope that helps clear it up!
This is exactly what I've been looking for. It's more than 2 years old, but still answered some questions I had. Very well explained, easy to follow and extremely useful and educational.
I'm glad it was helpful!
Theres a lot to learn from this. Thank you so much.
Finally I know how to use a database with javascript.
What I need to know how is making profiles so that the database has it's use
so that unique users of a website have slightly different experience
You're very welcome!
I need that too
@@sekokhan5307 how are you now?
wow! i've bought a bunch of udemy courses and watched trillions of tutorials.
this is the first time i really felt like i've learned something that takes me one step further to being a developer
I am so happy to hear this tutorial helped you! Keep going!
are we using rest api here ????
Thanks again for this tutorial!
If you are getting this error: "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
db disconnected",
then try to change the USER in .env file to USERS and also change USER in connection in dbService to USERS. This will resolve the problem.
This problem is caused as there seems to be an inbuilt variable USER in env so when a connection was made, instead of getting the specific username, the deafult USER value was used that caused this error.
I guess you are wrong The main reason why this error occurs is because when we make a new user in mysql ,it uses caching_sha2_password plugin for user authentication by default. We can check the authentication plugin for users using the command: SELECT user,plugin,host FROM mysql.user;It will show u a table like this.
+------------------+-----------------------+-----------+
| user | plugin | host |
+------------------+-----------------------+-----------+
| mysql.infoschema | caching_sha2_password | localhost |
| mysql.session | caching_sha2_password | localhost |
| mysql.sys | caching_sha2_password | localhost |
| root | caching_sha2_password | localhost |
| tutorial | mysql_native_password | localhost |
| web_app | caching_sha2_password | localhost |
+------------------+-----------------------+-----------+
According to mysql docs :
The caching_sha2_password and sha256_password authentication plugins provide more secure password encryption than the mysql_native_password plugin, and caching_sha2_password provides better performance than sha256_password. Due to these superior security and performance characteristics of caching_sha2_password, it is as of MySQL 8.0 the preferred authentication plugin, and is also the default authentication plugin rather than mysql_native_password. This change affects both the server and the libmysqlclient client library:
So if you have already created a user and you want to change the plugin from caching_sha2_password to mysql_native_password write the following command:
ALTER USER myuser IDENTIFIED WITH mysql_native_password BY 'mypassword';
replacing myuser with username and mypassword with the password for the repective username.
Another thing that you could do is to create a new user with plugin mysql_native_password. To do that you could use the following:
CREATE USER 'your_user'@'your_server_ip ' IDENTIFIED WITH mysql_native_password BY 'your_password';
we need more apps like this , thank you man ♥
Absolutely I will create more tutorials revolving about full stack web development.
I was hoping adding React Redux to this would have made it a hit
Thank you so much. It's nice to be able to put something together from start to finish. It's so helpful to actually connect to a database. This should be a springboard to bigger and better.
You're welcome! I'm glad it was helpful!
This tutorial was extremely interesting and helpful. By far the best explanation of how to use mySQL with Node Js. Thank you very much! :)
You're very welcome :)
Yo thanks for this tutorial, the internet desperately needs more node mysql tutorials of quality like this one. Mongodb, even though I like it, seems overhyped.
Absolutely! Thank you so much!
I will definitely add more tutorials with mysql. Usually all my tutorials with a database will be with mysql.
I agree
don't hesitate to make more of this. really good, and easy to understand.
I’m open to suggestions if you want to see a video on something specific.
been searching for this for over a week, thank you very much
If you have any trouble with nodemon saying "nodemon: command not found", I found this Stack Overflow answer which helped me...
```
npx nodemon [your-app.js]
```
With a local installation, nodemon will not be available in your system path. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`.
You deserve more attention than all those of 300k sub channel owners - thank you for this tutorial
Wow I really appreciate that! Thank you
best tutorial on youtube hands down
Great tutorial, addressed my needs directly without a drop of wasted time.
Thank you I really appreciate it!
Bole to...jhkas...... converting .then to....async await.... loving it ❤️
Thank you very much, this video helped me to build a full-stack application for my final-year project and I got A
I'm happy to hear that!
Loved this tutorial. Still the best out there for node js with mysql. I was able to modify this to add football players and stats to a data base and filter across any stat. Now I have it working great I just a little stuck on how to deploy It so my group of 20 friends can access it without a monthly fee for hosting the database. Any thoughts or videos on self hosting this app?
Wow, awesome tutorial, you have a nice voice-concise and understandable explanation. Thank you for sharing your video. God bless you....
You're very welcome!! I'm glad it was helpful. Thank you for such a nice compliment.
Thanks for the tutorial, question if I may
in the insertNewName function you have
resolve(result.insertId);
What is .insertId please? is this a class variable from the result in connection query? Im asking because I dont set that
myself anywehere.
is resolve(result.affectedRows); the same as well?
Thanks
thank you for video!!! tutorial so cool !!!! it will be great if someday you make tutorial about authorization in nodeJS with mysql !!! Thanks a lot !!!!!!!
You're welcome! I really appreciate this comment! I will definitely make a video about auth with nodejs and MySQL.
Check out The NetNinja, he's cool too
Awesome sir,
Thanks for such detailed explanation in 90 min, It really helps alot
You're very welcome!
Your video was really helpful it got me out of a very serious problem i cannot thank you enough :)
You're welcome! I'm glad it helped you solve your problem!
Thanks for this course... should've found it months ago.
I'm having trouble with mysql and mysql2 imports and exports. Is there somewhere I could get the complete finished code?
Hey man, thanks for the tutorial, it was my first crud and you really helped me out.
I'm happy to hear that!
truly appreciated this. great tempo, explanation, utility
Thank you so much. its helped me a lot for DRY code rules.
Thank you man for this amazing tutorial. Really helped for a project I am working on! Keep up the nice work!
My addBtn is giving me error on my browser console any idea how I can fix this
do you have a new one ?, its been for years so i need a new update of these code, hope you can help me, your video is very useful.
Just discovered your channel, your tutorials are awesome! Would you consider making email registration and login for this system to fully round out the app? Thanks for your time and knowledge.
Awesome bro..this type tutorial i prefer..backend and front explain..simple to understand!!keep it up bro..
and i got question..can we connect from multiple db in 1 server and how to declare it.
I'm glad you liked it!
Yeah we can definitely connect to more than 1 db in the server. I know I always set the db in my config.
One way you can connect to multiple dbs is have multiple connection files specific to what db want you want to connect to.
@@NsquaredCoding example i have 2 app..one using wordpress and codigniter.i need my user can access both in 1 user acc.how to make auth global.if posible guide with login/registration too...hehehe..thanks
Thank you for the video. Although I do have problem and that is that I can't display or console.log the insertId. It returns as undefined. Yet in xampp I can view it.
Nice video brother, but you didn't show that how did you connect your database .
Nice work bro, can u show how u can create a sign in/create account and have a user profile so different users have different data?
This is very helpful but my dbService also got disconnected but mine didnt tell me anything about passwords and stuff like that just in the terminal it said dbdisconnected
After doing everything, i keep getting the error 'data is not defined'... i did everything as you did.
The voice of the tutor sounds like Patrick Jane from The Mentalist TV Series.
This DbService its exactly what i am searching for! Thank you a lot!
You're very welcome!
I want to know that how can you show the data of the row you are editing in edit row input meaning i want that when i click on edit button the value of that row should be filled in the input
This is way too much for me, but i somehow got it in my app. Thanks
Glad it works!
Excellent tutorial. Thank you.
Awesome ! you are among the best !
Thank you so much! That means a lot
This is probably a silly question, but i'm a newbie. What languages (i.e. Javascript) would I need to learn to full understand the programming concepts/syntax behind this video?
No silly questions! I'm happy to help.
Mostly JavaScript for the client side in the browser and then in the backend as well for using the Node runtime.
Then there is MySQL which is a query language for the database.
For the web page you'll need to know HTML to build the table and CSS to style your HTML like changing the color for example.
are we using rest api here ????
Yes we are using a restful API with express.
Sir, Thanks for the video it was so helpful. I am running on localhost:8080 and cant run please can you help me.
Useful content!
Hey man, thanks for this cool project. I was wondering if no data found in the search input, it should say "No Data Found" but in the tutorial you didn't implement that. I coulnd't figure out the implementation.
Nice tutorial!) But it is sad that you didnt show how to refresh data without reloading page. Anyway, nice job! Appreciate it
Thank you!
To refresh the data without reloading the page we need to rebuild the table each time in javascript and then render it to the dom.
Let me know if that helps or you want to know more about the implementation.
@@NsquaredCoding I just enclosed the fetch inside a function called 'showTable' and every time i add data i call this function and it updates the table without reloading the page
Hi, nice tutorial it helps me a lot.
I have a smal problem. So in the tabel on my webseit the name is showd but the id and Date will be showd with undefind. I do not realy now the problem.
If I want to parse the Date it says invalid Date.
I hope some one can help me.
Thx
Hi, thanks for your explanation.. i am confused that how nodejs and apache webserver runs on the same server? Does it affect performance? Is it possible to deploy nodejs and mysql without apache?
Amazing video and super informative! Thank you😁!
Just a short question, to import the package, what if we use powershell or cmd instead of bash. Anyone knows?
the 1:25 issue in my case was in unpadteBtn.onClick's id was being taken from input's dataset.id but should have taken from button's
Same issue and your comment was a life saver God bless
Thank you!
I want to convert server api from .Net to ExpressJs and then I found this video.
In .Net we get data from data base with EntityFramwork(use LINQ) and in JS we get data with query sql, right?
And I want to know how to create database in code, migration data base, (add new table, edit(delete, add column) table).
Can you make a video for that?
Thank a lot!
Could you build the same api using MySql Workbench, and also conduct all back-end and front-end functionalities in one js file? Its a little confusing .env file as I haven't used that in my last task where I created a dynamic webpage using mongodb. Was just wondering as I wanted to do it easier way. Thanks.
Once you add a new record to the database you don't need to recreate the function to load data into the table .... you already have that function (loadHTMLTable) and you can just call it again.
my console.log(response) at 34:06 is not printing the empty array in console.. I have written same code.. please help me out
any solutions?
It was so great and helpful, many thanks for this tutorial!
You're very welcome!
Great tutorial thanks. i just subbed. keep going man
Thank you! That means a lot
I wish there's a shortcut to refresh the page instead adding code between 52:06 -1:00:48.
Now I see why people choose React or Vue instead of plain HTML with javascript. In React, all you need is useEffect() to refresh.
Anyway, 52:48 I don't know how MySql INSERT statement return id. Does it return inserted id by default?
Also, anyone can explain this: data['data'] what does it mean? Where is '.no-data' in index.html?
You're right, a client side framework definitely has its advantages in these cases.
Yes you will get an insert id back when you execute an insert operation.
Data is an object and inside that object there is a key that is also called data. We are accessing that key inside the data object.
I believe .no-data is being inserted dynamically from Javascript. I'll need to look at the code to double check.
@@NsquaredCoding Thank you so much. Sorry for causing confusion. '.no-data' is in loadingHTMLtable function. I was focusing too much on Insert function that I forgot 'no-data' is dynamic table.
Hi NSquared Coding, when I run 'nodemon app,' it's saying the command isn't found. I've done npm install 'nodemon --save-dev' Do you know why this isn't working?
Can you look in your packages.json file to make sure it is installed and you are in the same directory where the packages.json file is
I installed it like this 'npm install --save nodemon"
and my package.json is like this:
"name": "server",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "nodemon index.js",
"devStart": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1"
make you're in 'server' folder to run command 'npm start'
You helped me a lot, god bless you thanks!
You're very welcome!
It is a very good tutorial!
I have some issues. can you help me? I dont know why but document.querySelector('table tbody') dont work 10:15
but if i use document.getElementById('tablebody') and add id to table body it works... how to solve this?
Inside your query selector you need to #
In front to specify it's an id you're looking for. That should fix it!
@@NsquaredCoding Thank you so much for your quick response! Yeah, that solved my problem. But I still need to specify otherwise document.querySelector ('# table-Body') doesn't work. I don't understand, because for you and everyone here have everything working as it should, no one has any questions on this. It is difficult to study JS when faced with a similar misunderstanding of the problem
Really great video! How do i reset the ID when my table is empty?
There is a sql command you can run to reset the primary id
do i need to install dotenv? I'm getting error "Missing destination operand".
man, you did awesome job, thanks and greats and congratulations:)
Thank you so much!
18:00 followed everything up to this point and when I say nodemon app it says command not found. What do I do now?
if your db is not connecting, try update your user in phpmyadmin by giving yourself all privileges (global privileges: select all)
Hey dude, i'm following this tutorial you brought. I trying add three data column attributes for table from my database i've created, example I created ("name", "address", "no. Telp") into table. Then, can you tell me how fetch those three data column into table to view in website is working?
Btw, love you videos.
Hey so you'll need to perform a select query to retrieve those columns. Does that help?
@@NsquaredCoding yeah, i added it. And it worked after i used to create "insert" and "delete" query for table, except i have problem those "update" for editing data I want and can't change those three attribute, and I got some error because it's from relationship between function from index and app , and it's said "Uncaught (in Promise) Syntax Error: JSON.parse: unexpected character... " and "XHR Patch 404... " In console my log. Can you tell me hint how to fix it?
Did someone also had problems with implementing the code ? my buttons are not working/showing at all, i am not sure where exactly the problem is.
Sir, please tell me how did you changed in privileges as username and other things at 27:28 . I am really facing issue in my code. I am getting same error which you got early
Please help🙏
For some reason, when I try to add a new user to give privileges to the database, the checkbox: "Grant all privileges on database web_app" is missing. The first two checkboxes are there, but not the one I actually need checked.
Because of that, the app will not connect unless I change the username of the new account in phpMyAdmin to my actual local username in my computer. Otherwise, if I change the name to 'tutorial', it won't work.
Any help would be appreciated. Thanks!
On update I've got this error " uncaught ( in promise) TypeError: Failed to fetch" have worked with headers: { 'Content- type': 'application/json' } & still not working. why?
solved i found that i didn't set id well to the edited raw
On beginning of the video when you present demo of this application on first udpate is not refreshing the page but on second update action is refreshing the page, what is the difference?
Hmm I saw that, it might have happened really fast.
In this project it should refresh the page when clicking on update. There should be no difference. I hope that clears up any confusion.
Nsquared Coding it can be in real time add, edit, remove? Like firebase.
Please create content about sql injection
When I start to add code after 17:00 No Data in the table disappear I don't know what is the problem
Hi i wanna ask smth tht around 27:40s u changed the user name and i did too and i got this error [ ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client ]. Can u answer to my question? and i use mysql-workbench not xxamp if this can make problem?
HI. can you please tell me how i can modify this code to add a dropdown menu instead of a table?
u have changed user name indirectly . how do we know what are the changes required correct the connection request. iam new to this language. iam following a this videos .actually its awsm . But iam stucked in that connection part. how can i clear that
at around 41:30 i start to get "ReferenceError: require is not defined" also and probably unrelated the whole time through the app sometimes runs and sometimes complains that "listen EADDRINUSE: address already in use :::5000"
Getting error something like " promise is not defined" can u plzz help
Thanks for a great tutorial. But I can't get the connection to the database to work ! I also get: ER_ACCESS_DENIED_ERROR How can I fix it. For me it seems that the file .env is not working. Can anyone help me??
Have you installed the dotenv package?
npm install dotenv
Make sure you are importing it correctly as well
thanks for this amazing tutorial
No problem!
Thank you for this one!
Can u tell us , how to deploy the client side to a host( netlify for example) and talk to our server (node.js).
I mean, i want to visit the website on my phone, and to send some data to the server, so i can store them in MySQL. Is is possible?
There are many examples already on how to deploy to netlify. If you want to host a full stack project look into using heroku. They have a free tier.
@@NsquaredCoding Oh, u replied! what a god! Thank you
How would I host a full stack app? Do I need to host the server side code somewhere and then host the client side stuff some place else??
Thanks a bunch for posting it! I'm also wanting to learn to do the same. I haven't hosted a full stack app myself either. I will read into this.
hosting on Heroku is great for full stack apps
@@JenniferStewart100 Can you help me out with how to host it on heroku
Did any of you guys end up hosting this project somewhere? I'm trying to do the same thing and could use some advice if either of you did.
Finished Thanks a lot ❤ sir
You're welcome!
Great tutorial
I'm glad you liked it!
Timestamp: 34:30 - Address (Port) Already in Use. I am receiving this error message when trying to run the first SELECT. It is reporting that the database port is already in use. The DB Server is serving other applications - the application should not be reporting this - correct? I know that I can use a mysql pool to respond to db requests - can you share how the code would change by using a Pool instead of connection?
I’m getting error that document is not defined any solution please @Nsquared Coding
Please did you solve this?
I solved it finally my issue was that I was in the client side of the project and not server side check if that's your issue too
Hello Sir can help for making video on Signuo and login form with mysql workbench..
In 29:08
in the code "return instance? instance: new dbservice"
won't the instance always be null since there appears to be no code that changes it to not null if new dbservice object is created?
Yes you are right! Silly mistake on my part. It should be returning the variable after we set the new instance to the variable.
mine is working wooh, is it hard to move this online to a website? I assume it's just changing the directory paths, etc?
Hi, could you help me with a situation i was running nodemon app but i got the problem "[nodemon] app crashed - waiting for file changes before starting..." may you have idea how to fix this?
There must be an error in one of your files which may be crashing it. Try to stop the server and then restart it if you believe there aren't any errors.
Why mysql with node tutorials are less? Thnx man
how to start frontend? i start it with nodemon index.js and get this error ReferenceError: document is not defined
That will start your backend server. You need to creat an html file with a JavaScript file that will be included in your html file. Open the html file in your browser and you should be good to go.
In timestamp around 18:58 servers runs and shows "test". But in inspect it is showing [Uncaught ReferenceError: require is not defined]
I am new to node js and i am not able to rectify it.
Can you paste app.js code here where you are using require
Hello great tutorial and all but at the update part the section where you added the header on the fetch of updatebtn. When I followed it I’m only getting the name and not the id of updateNameInput. How to fix this :(
If I remember correctly the Id is being set in the html element. Are you see it there in the Dom?
how did you solve this?
Hi Nsquare;
I still didnt understand this part of tutorial:
static getDbServiceInstance() {
return instance ? instance : new DbService();
Since you already declare the instance = null..
Wouldn't the results will always will be null..
And I still cannot understand of this part , on what exactly is the purpose of getDbServiceInstance()..?
Btw.. great tutorial .. thankYou
Thank you!
That is to make sure we are only getting one instance of the db class. If we are making multiple queries and are using this class there is no need to make multiple instances of this class. It will return the original instance that was created. I hope that helps clear it up!
Thank you ! it was a really good tutorial.
You're welcome! I'm glad it was helpful!
Hello
I am newer to NODE and I am getting this error when I try to pst
TypeError: Cannot read property 'insertId' of undefined
Were you able to resolve the problem?
The reason this is happening is because the response variable you are trying to access insertId is undefined.
the nodemon command did not work for me, I had to install nodemon globally
npm install -g nodemon