I'm working right now in Dropdownlist pagination. But the problem is I don't know the next step that I'm going to do.
Here's the script. The dropdownlist value is correct, but I don't know how to finish this script. What I need is when I select in pagination dropdown it show the records base on itemperpage. But this script is not working.
$('#pageNo').on('change', function(){
var loadPage = $('#pageNo').val();
// Do your page submit to load another page
});
get.php
<?php
$mysqli = new mysqli("localhost", "root", "", "app");
$id = $mysqli->real_escape_string($_GET["q"]);//used for Dynamic Dropdown
$id2 = $mysqli->real_escape_string($_GET["id"]); // used for PHP pagination
$sql = $mysqli->query("SELECT * FROM app ORDER BY id ASC");
$nr = mysqli_num_rows($sql);
$itemsPerPage = 100;
$page_count = ($nr / $itemsPerPage) + 1;
echo"<select id='pageNo'>";
for($y=1; $y < $page_count; $y++) {
echo "<option value='".$y."'>".$y."</option>";
}
echo'</select>';
?>
Select.php
<script>
function showUser(str,ids) {
var $txtHint = $('#txtHint');
if (str=="" || ids=="") {
$txtHint.html('');
return;
}
$txtHint.load('get.php?q='+str+'&id='+ids)
}
</script>
<body onload=showUser(str="ALL")>
<select name="drop_1" id="drop_1" onchange="showUser(this.value)" style="overflow:scroll;width:100px;">
<option value="ALL" selected='ALL'>ALL</option>
<?php getTierOne(); ?>
</select>
<div id="txtHint"></div>
Probably easier to do it in your sql
$sql = $mysqli->query("SELECT * FROM app ORDER BY id ASC LIMIT ".$pagenum*100.",100");