Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch.php
- <?php
- include('converte_data.php');
- if(isset($_POST["limit"], $_POST["start"]))
- {
- $connect = mysqli_connect("host", "usuario", "senha", "banco de dados");
- $query = "SELECT * FROM imagem ORDER BY id DESC LIMIT ".$_POST["start"].", ".$_POST["limit"]."";
- $result = mysqli_query($connect, $query);
- while($row = mysqli_fetch_array($result))
- { ?>
- <div class="row">
- <?php
- $cont = 0;
- foreach ($result as $foto) {
- $cont++;
- ?>
- <div class="col-sm-4">
- <div class="shadow p-3 mb-5 bg-white rounded">
- <?php echo converte_data($foto['data']); ?><br>
- <?php echo "".$foto["assunto"]?><br>
- <a href="<?php echo $foto["url"]; ?>" target="_blank"><img src="imagens/<?php echo $foto["nome"]; ?>" width="100%" class="img-fluid"></a><br>
- <div class="descricao">
- <?php echo substr(nl2br($foto['descricao']), 0, 43); ?>...<br>
- </div>
- </div>
- </div>
- <?php
- if($cont ==3){
- echo "</div>";
- echo "<div class='row'>";
- $cont = 0;
- }
- }
- ?>
- </div>
- <?php
- ?>
- <?php
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement