Advertisement
Guest User

Untitled

a guest
Mar 14th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $('.show_more').on('click',function (e){
  4. $.ajax({
  5. type:'POST',
  6. url:'gallery_controller.php',
  7. success:function(html){
  8. $('.content').append(html);
  9. }
  10. });
  11. });
  12.  
  13. <form action="" method="post">
  14. <button type="submit" class="show_more" name="next">Next</button>
  15. </form>
  16.  
  17. <?php
  18. $servername = "localhost";
  19. $username = "root";
  20. $password = "";
  21.  
  22. $conn = new mysqli($servername, $username, $password, "dbgallery");
  23.  
  24. if ($conn->connect_error) {
  25. die("Connection failed: " . $conn->connect_error);
  26. }
  27.  
  28. $result = $conn->query("SELECT imagefile FROM tbl_images ORDER BY id DESC LIMIT 10 OFFSET 0");
  29.  
  30. while($row = $result->fetch_assoc()) {
  31.  
  32. echo '<h1>'.$row["imagefile"].'</h1><hr />';
  33.  
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement