Skip to content

Instantly share code, notes, and snippets.

@hackerrahul
Created May 26, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackerrahul/398ca43e7b2a90509b87a132d3b79860 to your computer and use it in GitHub Desktop.
Save hackerrahul/398ca43e7b2a90509b87a132d3b79860 to your computer and use it in GitHub Desktop.
<?php
include 'db.php';
if (isset($_GET['offset']) && isset($_GET['limit'])) {
$offset = $_GET['offset'];
$limit = $_GET['limit'];
$data = mysqli_query($conn, "SELECT * FROM infinite_scroll_post LIMIT {$limit} OFFSET {$offset}");
while($row = mysqli_fetch_array($data)){
echo "<div class='w3-card-4' >
<header class='w3-container w3-blue'>
<a href='".$row['url']."' title='".$row['title']."'><h1>".$row['title']."</h1></a>
</header>
<div class='w3-container'>
<h1>".$row['body']."</h1> </div>
</div><br><br>
";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment