Direct link between html5 and mysql

I am new to HTML5. I know this is a stupid question, but I've heard about connecting between mysql and html5 using php. but can we make a direct link between both without php? If so, please direct me with your suggestions and tutorials.

+3


source to share


2 answers


HTML alone will prevent you from connecting to mysql database. But yes, server side javascript can help you achieve what you are trying to do. There are node.js modules available to connect and query the mysql database. You need to install node.js and then you can write the backend in Javascript.



https://github.com/joyent/node/wiki/modules#wiki-db-mysql

+1


source


Well, you won't be able to directly connect to it using html5 as it works client side. This means that the code for html5 (most likely some form of javascript) will run on the client, but your mysql system is on a different server. Generally, you do not directly access the database on the Internet (security reasons).

On the other hand, as other posters have pointed out, you can run a javascript server. I'm not sure why you would want to do this, although php is probably a more powerful and more suitable tool for this type of operation.



You can do it with php though, as you mentioned. Check http://us3.php.net/manual/en/function.mysql-connect.php

+2


source







All Articles