Advertisement
yesamarcos

Tenta algo assim ....

Jul 25th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. include '../painelanime/connection.php';
  4.  
  5. $alfabeto = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
  6.  
  7. foreach($alfabeto as $letra){
  8.  
  9.     $sql = "SELECT * FROM animes WHERE nomeanime LIKE '%$letra'";
  10.     $query = mysqli_query($link, $sql);
  11.     $dados = $query->fetch_array(MYSQLI_ASSOC);
  12.  
  13.     $nomeanime      = $dados['nomeanime'];
  14.     $nome           = $dados['nomeanime'];
  15.     $nome           = substr($nome, 0,25);
  16.     $nome          .= '...';
  17.     $id             = $dados['id'];
  18.  
  19.     echo "<div class='box-lanc'>";
  20.     echo "<p lang='{$id}'>";
  21.     echo "<div style='background: #f2f2f2 !important;' class='panel panel-default'>";
  22.     echo "<div style='background: #111 !important; color: #ccc;' class='panel-heading'><a href='?page=page-anime&id=".$dados['id']."'>$nome</a></div>";
  23.     echo "<div class='panel-body'><img width='215' height='160' title='$nomeanime' src='".$dados['thumb']."' /></div>";
  24.     echo "</div>";
  25.     echo "</div>";
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement