0

I am using jQuery UI on the front end. I want to get the values off MySQL database on my page on a mouseclick using AJAX.

How do I retrieve data from MySQL using jQuery and update my div with the new HTML without a page refresh?

Thanks

3 Answers 3

2

You have to provide a service tier, which can be something like a PHP or ASP.net page that gets the $.ajax request from jQuery and executes a query against MySQL backend, then it will recieve the result from the DB,translate it back to something understandable from javascript side, (such as JSON)

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

Comments

1

I believe you will need a server side controller or script to do the actual MySQL query. See this thread.

Comments

0

In Jquery there's a very helpful $ajax function using which you can send Get/Post requests to any webpage and use the retrieved information (which can be HTML) in your page.

Just give $ajax a look and your problem is solved. Though I don't hail from the PHP worls so I can't give you the exact code. Google 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.