0

Apologies if this has been asked before but I'm not sure what to search for exactly so I thought it would be better to explain it.

I am using php to get records from a mysql table and present them. However I have added couple of dropdowns and search boxes to filter out the results and I would like to do it without refreshing the page. Can anyone point me to a tutorial or something like that? I guess I should use jQuery but as I said I don't know what to look for exactly.

Thank you!

user43051
  • 345
  • 2
  • 5
  • 17
  • 2
    You have to use ajax. http://www.w3schools.com/php/php_ajax_database.asp – Sadikhasan Jun 24 '14 at 05:37
  • 1
    You either have to use Ajax, or if you're loading the complete result set, then you can filter with javascript/jquery. There are many pre-written plugins such as DTable for Jquery – Kylie Jun 24 '14 at 05:38
  • 1
    possible duplicate of [Jquery Ajax Refresh without reload or load the page](http://stackoverflow.com/questions/2721388/jquery-ajax-refresh-without-reload-or-load-the-page) – Yaje Jun 24 '14 at 05:40

3 Answers3

1

You need to use AJAX at client side:

Here are few good examples:

http://www.w3schools.com/php/php_ajax_database.asp

Using Jquery Ajax to retrieve data from Mysql

Community
  • 1
  • 1
Sunny Sharma
  • 4,688
  • 5
  • 35
  • 73
1

You can use ajax in jQuery.

Here is a quick look at the ajax API.

And a tutorial guide for ajax:

http://learn.jquery.com/ajax/

And a tutorial for getting started with jquery ajax call

http://www.keyboardninja.eu/webdevelopment/jquery-ajax-call-tutorial

Karthik Chintala
  • 5,465
  • 5
  • 30
  • 60
0

AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

The XMLHttpRequest object is part of a technology called Ajax (Asynchronous JavaScript and XML). Using Ajax, data could then be passed between the browser and the server, using the XMLHttpRequest API, without having to reload the web page

You can get AJAX Examples Here

AkshayP
  • 2,141
  • 2
  • 18
  • 27