Let me explain better, I have a javascript program, in which I have to generate events with fullcalendar, I have thought that the best way (or, at least, the one that will work for me) is to make a function in javascript where I obtain the data of the database, insert each column of the database into a different array and then with an if loop separate them.
If you follow the link of that answer you will find that in the end the person used the classic JavaScript model for the front end and the back end with PHP so you will not find more detail about it.
I found this in a w3schools tutorial that will help you further in what you are looking for and basically these are the steps to follow
Install the MySQL driver
Node.js
You can use this module to manipulate the MySQL database:Create a connection
Check the database
The object
con
in the example above has a method to query the database:The method
query
takes asentencia sql
as a parameter and returns the result.