Of course, you will always get the same data with this sql expression!
The first thing you need to do is try to pass the data as an object ....
$.ajax({ type: "post", url: "content.php", data: { contentid: contentid, collegename: collegename }, success: function(response) { var $loaderImg = $(this).parent().find(".loadingdata").hide(); $content.html(response).prepend($loaderImg); } });
than you can easily capture this in php, for example, for example. $_POST['data']['contentid']
Than you have several options for getting the content you are looking for ....
Could limit the result
$amount = 10; $offset = ($_POST['data']['contentid']?$_POST['data']['contentid']*$amount:0); $query = "SELECT * FROM ".$collegename." LIMIT {$offset}, {$amount} ";
For example, you pass 0 as id, you get the first 10 results, when you pass 1, you get the next 10 results ... and so on ...
as i said, this is only one way to do this :)
source share