Advertisement
Guest User

Untitled

a guest
Nov 27th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. <div class="row">
  2. <!-- This is the set up of a basic gallery, your items must have the categories they belong to in a data-category
  3. attribute, which starts from the value 1 and goes up from there -->
  4. <div class="filtr-container">
  5. <?php
  6. $servername = "NOM SERVIDOR";
  7. $username = "USUARI";
  8. $password = "PASWORD";
  9. $dbname = "NOM BASE DE DADES";
  10. // Create connection
  11. $conn = new mysqli($servername, $username, $password, $dbname);
  12. // Check connection
  13. if ($conn->connect_error) {
  14. die("Connection failed: " . $conn->connect_error);
  15. }
  16. $sql = "SELECT * FROM `bergueda`";
  17. $result = $conn->query($sql);
  18. if ($result->num_rows > 0) {
  19. // output data of each row
  20. while($row = $result->fetch_assoc()) {
  21. ?>
  22. <div class="col-xs-6 col-sm-4 col-md-3 filtr-item" data-category="<?php echo "$row[num_cat]";?>" data-sort="<?php echo "$row[titol]";?>">
  23.  
  24. <a href="<?php echo "$row[url_img]";?>" data-lightbox="<?php echo "$row[titol]";?>"><img class="img-responsive" src="<?php echo "$row[url_img]";?>" alt="?" title="<?php echo "$row[titol]";?>" /></a>
  25. <span class="item-desc"><?php echo "$row[titol]";?></span>
  26. </div>
  27.  
  28.  
  29. <?php }
  30. } else {
  31. echo "0 results";
  32. }
  33. $conn->close();
  34. ?>
  35.  
  36.  
  37.  
  38. </div>
  39. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement