I'm developing a website for myself and would like to know if I can use JavaScript to connect to the database and get a value.
The site is local, and the bank is also on my machine, do you know if I can connect using JS? How?
I'm developing a website for myself and would like to know if I can use JavaScript to connect to the database and get a value.
The site is local, and the bank is also on my machine, do you know if I can connect using JS? How?
The javascript should be used only and exclusively for the client side, more precisely in the browser sandbox.
To communicate with the database you will inevitably need to work with some server side language. I personally indicate PHP in these cases because it has almost zero dependency and most web servers have it by default.
In MySQL 5.7 you have the HTTP Plugin with which you can do what you want. There are other means as well, but this is the best known. The plugin is basically a REST API.
Another way is by using ActiveXObject, connecting through the ODBC ADODB. Of course in this case the browser must have permissions enabled to access the ActiveX object.