Reputation: 1
I want to connect to a mysql database using javascript.
If it is possible, how can I do this?
Upvotes: 0
Views: 656
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