View Full Version : Navigation through records

11-02-2012, 05:50 PM
hi, I am generating records through php/sql, as u can see the code displays 5 records, what Im trying to do is program so that when the next button is pressed the next 5 records will show?? any help much appreciated thank you,

the code -

function show(qstring,qtype){
var myurl="scripts/searchpage.php";
url: myurl, dataType:'json',data:{querystring:qstring,querytype:qtype},
success: function(member){
$("#results").append('<tr class="me">'+
var j=0;var totrecs=1;
for(var i=0;i<5;i++){
$("#results").append('<tr class="rows'+j+'">'+
'<td class="ids" id="z'+i+'">'+totrecs+'</td>'+
'<td class="users" id="username'+i+'">'+member[i].username+'</td>'+
'<td id="contact'+i+'">'+member[i].fname+' '+member[i].lname+'</td>'+
'<td><input type="checkbox" name="whome" id="showMe'+i+'"'+
'class="boxes" onclick="getMe('+i+')" /></td></tr>');

and for the html button -

<input type="button" id="next5" title="Next 5 Records" disabled="disabled" value="Next 5>>" />

11-02-2012, 06:36 PM
well, what records are shown by your function appear to be controlled by parameters from qstring, which is provided to show() when it is called, so it really depends on what data you are putting in the qstring.