Guest User

Untitled

a guest
Nov 17th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <ul class="roh-list">
  2. <?php
  3. $sql = "
  4. SELECT DISTINCT(category) AS category FROM mytable WHERE subject = 'animals' && subcat = 'cats'
  5. ";
  6.  
  7. $results = $db->query($sql);
  8.  
  9. if($results->num_rows) {
  10. While($row = $results->fetch_object()) {
  11. echo "
  12.  
  13. <li><a href='categories/{$row->thing}/roh-index.php'>{$row->category}</a></li>
  14.  
  15.  
  16. ";
  17. }
  18. } else {
  19. echo 'No Results';
  20. }
  21. ?>
  22. </ul>
Add Comment
Please, Sign In to add comment