Public paste
Undefined
By: Lundy | Date: Mar 24 2009 13:38 | Format: PHP | Expires: never | Size: 742 B | Hits: 1115

  1. <?php
  2. $result = mysql_query('SELECT id, cat FROM grupo_cat_links');
  3. $cats = array();
  4.  
  5. echo "<pre>";
  6. while ($row = mysql_fetch_assoc($result)) {
  7. $row['items'] = array();
  8. $cats[$row['id']] = $row;
  9. print_r($row);
  10. echo "<br>";
  11. print_r($row['items']);
  12. echo "<br>";
  13. print_r($cats);
  14. }
  15.  
  16.  
  17. $result = mysql_query('SELECT id, lg, catlinks, name, link FROM grupo_links');
  18. while ($row = mysql_fetch_assoc($result)) { $cats[$row['id']]['items'][] = $row; }
  19. {     $catlinks = $result['catlinks'];
  20.     $lg = $result['lg'];
  21.     $link = $result['link'];
  22.     $name = $result['name'];
  23. echo "<h6>".$catlinks."</h6>";
  24. echo "<li><img src='../".$lg."' alt=''/> <a href='".$link."' target='_blank'>".$name."</a></li>";
  25. echo "<br>";
  26. }
  27. ?>