title: pagination in php
body: <p>i am using this to collect comments made abt a particular user. i want to display 7 comments on each page and want to enable pagination. 
  what would be the steps of implementation. sorry. n00b question.</p>
  
  <pre><code>$query = "SELECT msg, user_id, comment_time FROM comments WHERE aid = '$aid' ORDER BY comment_time DESC";
          $result = mysql_query($query) or die("ERROR: $query.".mysql_error());
          if (mysql_num_rows($result) &gt; 0) {
              while($row = mysql_fetch_object($result)){
                  $uidval = $row-&gt;user_id;
                  if ($uidval != 0){
                  $userInfo = $facebook-&gt;api_client-&gt;fql_query("SELECT name, pic_square_with_logo, profile_url FROM user WHERE uid='".$uidval."'");
  
              //  echo '&lt;br&gt;Array Info&lt;br&gt;';
              //  print_r($userInfo);
              //  echo '&lt;br&gt;&lt;br&gt;';
  
                  $nameuser = $userInfo[0]['name'];
                  $pic = $userInfo[0]['pic_square_with_logo'];
                  $profile_url = $userInfo[0]['profile_url'];
  
                  echo '&lt;img src="'.$pic.'" /&gt;';
                  echo '&lt;a href="'.$profile_url.'"&gt;'.$nameuser.'&lt;/a&gt;';
                  echo '&lt;br&gt;';
                  echo $row-&gt;comment_time;
                  echo '&lt;br&gt;';
                  echo $row-&gt;msg;
                  echo '&lt;br&gt;';
                  }
  
              }
          }
  </code></pre>