Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $('.show_more').on('click',function (e){
- $.ajax({
- type:'POST',
- url:'gallery_controller.php',
- success:function(html){
- $('.content').append(html);
- }
- });
- });
- <form action="" method="post">
- <button type="submit" class="show_more" name="next">Next</button>
- </form>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $conn = new mysqli($servername, $username, $password, "dbgallery");
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $result = $conn->query("SELECT imagefile FROM tbl_images ORDER BY id DESC LIMIT 10 OFFSET 0");
- while($row = $result->fetch_assoc()) {
- echo '<h1>'.$row["imagefile"].'</h1><hr />';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement