Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- connect.php -->
- <?php
- $host = "localhost";
- $user = "root";
- $db = "fenix";
- $pass = "";
- try{
- $connect = new PDO("mysql:host=$host;dbname=$db",$user,$pass);
- }catch(PDOException $e){
- die("Error ".$e->getMessage());
- }
- <!-- index.php -->
- <?php
- require_once("connect.php");
- ?>
- <script type="text/javascript">
- $(document).ready(function(){
- $("#carregar_mais").click(function(){
- <?php $limite = $limite + 9;?>
- });
- });
- </script>
- <?php
- $results = $connect->query("SELECT * FROM arquivo ORDER BY id_arquivo DESC LIMIT $limite");
- ?>
- <div class="imagens">
- <?php
- while($row = $results->fetch(){ ?>
- <a href="upload/uploads/<?php echo $row['nome_arquivo'];?>" >
- <img class="imagem" src="upload/uploads/<?php echo $row['nome_arquivo'];?>" />
- </a>
- <?php } ?>
- </div>
- <center>
- <p id="carregar_mais" style="color:white; cursor:pointer;">Carregar mais</p>
- <?php echo $limite;?> <!-- Este echo é só para exibir em quanto está meu LIMIT-->
- </center>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement