Take the 2-minute tour ×

I have a php-mysql application that tracks and displays assignments to a help desk. It starts with a grid of assignments for the current month.

There are previous and next bars, which when clicked, display the previous or next month's assignments and this is accomplished using PHP self-submission.

I'd love to revise the application so that a click on previous or next month can be handled by jQuery's $.post() method but cant't figure out how to update my SQL statement and re-query.

The SQL statement has the form

    $sql = "SELECT * FROM $tbl WHERE monthnum = ".$monum
share|improve this question
add comment

3 Answers

if you look up post() in jQuery API, you will find a solution. you can achieve what you want by using

$.post('path_to_php_file_that_selects_data_from_db_and_echoes_it', function(data) {

if you want to add parameters to php file, send them through $_GET

share|improve this answer
add comment
$.post('ajax/test.html', function(data) {

Refer this link http://api.jquery.com/jQuery.post/

share|improve this answer
add comment

You can use jquery get method.

$.get("get_data.php", { month: "NEXT_MONTH" } , function(data) {

// replace current table html or do something to show retrieved data



And use the GET variable 'month' to decide which month data you need to return from get_data.php file

share|improve this answer
add comment

Your Answer


