Advertisement
Guest User

Untitled

a guest
Apr 20th, 2012
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. // get posts
  2. $posts = SelectAllPosts();
  3.  
  4. // loop through posts
  5. foreach($post as $p) {
  6.  
  7.     // print post title
  8.     print $p['title'];
  9.  
  10.     // get all comments for current post
  11.     $comments = SelectCommentsForPost($p);
  12.    
  13.     // loop through comments
  14.     foreach($comment as $c) {
  15.         // print comment title and message
  16.         print $c['title']
  17.         print $c['message'];
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement