1

G'Day,

Is it possible to query mySQL directly from within jQuery without having to use PHP/Python/Ruby etc.?

3
  • possible duplicate of Directly accessing server database via Ajax (without PHP or some other intermediate) Commented Feb 24, 2011 at 8:24
  • There is a very good reason that this is (next to) impossible to achieve. If users can directly acces your database, all your data is available to everybody! It's like having a direct shell into your mysql database! Commented Feb 24, 2011 at 8:30
  • I have a very specific need. The database and all clients are on a closed network, so while your concern about security is a valid one it is something I am able to exclude. Commented Feb 25, 2011 at 8:08

3 Answers 3

2

You can't do it with MySQL because it uses a binary protocol that the browser doesn't speak. You can do it with CouchDB, though, which uses HTTP and JSON so it's perfect for this kind of thing.

Sign up to request clarification or add additional context in comments.

Comments

0

no, jQuery is on client side and it isn't able to access directly to the database

1 Comment

So there is no way to open a TCP socket from JQuery? And there is no JavaScript library to access MySQL?
0

No you can not do it. Because all jquery code runs on client. You can use jquery ajax methods to call php or another webservices. Simply jquery or another javascript library can not do it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.