Hi i want to browse every 10 records on a click. The AJAX call should fetch next 10 records each from SQL QUERY when clicked on next or previous. At the initial page i have a SQL QUERY which fetches 10 records
SELECT VENUENAME FROM VENUES LIMIT 10
<a style="float:right" id="next-nav" href="#">Next</a>
$("#next-nav").click(function(){
$("#hidNavigation").val(parseInt($("#hidNavigation").val()) + 1);
$.ajax({
type: "POST",
url: "loaddynamic.cfm?template=mapresults&startrow=" + $("#hidNavigation").val(),
cache: false,
dataType: "json",
success: function(data){
//show venues
}
});
});
The query i am using inside AJAX page is
SELECT VENUENAME FROM VENUES LIMIT startrow, 10
I want records fetched to be unique and also the make the links(prev/next) non-clickable when it is at the start/end of the last record. Please help me. I am using MYSQL DB and jquery.