dinu
dinu

Reputation: 1

Connect to database using javascript

I want to connect to a mysql database using javascript.

If it is possible, how can I do this?

Upvotes: 0

Views: 656

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039488

You could use AJAX to send a request to your server side script which will query the MySQL database. Javascript has no way of accessing a SQL database directly because it runs on the client. Imagine if this was possible: it would mean that anyone from his client computer would be able to send any SQL query he likes to your MySQL server which hopefully is not possible.

Upvotes: 2

Related Questions