I'm struggling to send an incremented number to my PHP script to load more content. At the moment this script is fully working when I tested, but the number that is incremented by the jQuery when the page is scrolled does not send it to the PHP script. Therefore, the PHP script executes the same content on page scrolling. Could someone help me fix it?
Using jQuery you have sent an ajax post request with the data "getresult". However you have not yet taken this data in your php. Since this code is sent with the key "getresult", in php you can retrieve it by using
However since this parameter is optional, you can always use a variable like:
$limit = 0;
You can then alter this variable IF the post variable is present
if (isset($_POST["getresult"])) $limit = $_POST["getresult"];
Finally make sure that you use this variable inside the post instead of the 0
Photo1namefrom tbl_name limit ".$limit.",10")