Is it possible to interact with a MySQL database without PHP

As the question says, is it possible to interact with a MySQL database created using XAMPP (like using PhpMyAdmin) without using PHP, but only Javascript / JQuery?

This is just a theoretical question, I do not want to know how to do this (but if you know this, I want to refuse your help).

However, I do not mean using Ajax to send my request to the .php page, which then will interact with the database, but will interact directly without going through PHP.

+1
jquery ajax php mysql
source share
2 answers

In terms of a PHP application, it is impossible to interact with MySQL through JavaScript, because JavaScript is executed on the client side, that is, in the browser, it does not have access to anything on the server from which it is served.

However, nodejs is a JavaScript runtime built on Chrome V8 JavaScript - you can write a complete JavaScript server-side application without touching PHP. There is node-mysql , which means that you can interact with the MySQL database with JavaScript code.

There are several frameworks for web applications that can help you start and run something like Express , which saves you from having to write things like routing logic.

+3
source share

No, you cannot interact with MySQL through JavaScript or jQuery. You could use JavaScript and jQuery through your PHP pages if that were the functionality that you would be interested in. You can also use another language compatible with MySQL. Otherwise, interacting with MySQL directly through JavaScript / JQuery will not work.

+1
source share

All Articles