Infinite scroll data load from mysql database

I’m having problems with infinite scroll from item 21 on.

my code:

<?php // Include the database configuration file require 'dbConfig.php'; $limit = 20; // Get records from the database $query = $db->query("SELECT * FROM content ORDER BY id DESC LIMIT $limit"); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $postID = $row["id"]; $korting = round((1 - $row['price'] / $row['old_price'])*100,0); ?>
      <a class="external" href="<?php echo $row['url']; ?>" target="_blank" title="<?php echo $row['name']; ?>"><img src="<?php echo $row['picture_big']; ?>" alt="<?php echo $row['name']; ?>"></a>
      <div class="shop_item_details">
      <h4><a href="<?php echo $row['url']; ?>" target="_blank" title="<?php echo $row['name']; ?>"></a></h4>
      <div class="shop_item_price">&euro;<?php echo $row['price']; ?></div>
      <?php if ($row['old_price']!= '') { ?><div class="shop_item_price" style="text-decoration: line-through;">&euro;<?php echo $row['old_price']; ?></div><?php } ?>
      <a class="external" href="<?php echo $row['url']; ?>" target="_blank" id="addtocart">BEKIJKEN</a>
      <a href="#" data-popup=".popup-social" class="open-popup shopfav"><img src="images/icons/black/love.png" alt="" title="" /></a>

    <?php } } ?>

this works fine first 20 items, then i need to change some code in my-app.js

line 320

      // Generate new items HTML
      var html = '';
      for (var i = lastIndex + 1; i <= lastIndex + itemsPerLoad; i++) {
        html += '<li class="item-content"><div class="item-inner"><div class="item-title">Item ' + i + '</div></div></li>';

here i need to adjust php code to show images, price etc… from item 21 and more

Can anyone help me?

No one smart enough?