title: How to query for example only 30 users from row and then continue the query on the next page?
body: <p>I want to query limited result only on one page.<br>
  For example, the query will show 30 users from database on page 1, and then continue with another 30 on page 2 etc. For example Facebook messages when you go to conversation history and you have to click "show more" to load more previous messages.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>&lt;?php
  $dbhost = '';
  $dbuser = '';
  $dbpass = '';
  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  if(! $conn )
  {
    die('Could not connect: ' . mysql_error());
  }
  $sql = "SELECT * FROM members ORDER BY username";
  
  mysql_select_db('');
  $retval = mysql_query( $sql, $conn );
  if(! $retval )
  {
    die('Could not get data: ' . mysql_error());
  }
  while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
  {
      if($row['picture'] == ""){
      echo "&lt;img src='profile_pictures/public_icon.png' width='46' height='50'&gt;&lt;br&gt;";}else {
                                          echo " &lt;img width='50' height='50' src='profile_pictures/".$row['picture']."' alt='Profile Pic'&gt;&lt;br&gt;";
                                  }
      echo "&lt;b&gt;Email:&lt;/b&gt; {$row['email']} &lt;br&gt; ";
  
        echo "&lt;b&gt;Username: &lt;/b&gt;{$row['username']}  &lt;/p&gt; ";
      echo "&lt;hr class='hr' /&gt;";
  
  } 
  ?&gt;
  </code></pre>
  
  <p>This shows ALL user's information (email, profile picture and username) separated with hr.<br>
  The problem is that it displays ALL on one page. It would be big problem if there would be registered for example 1000 users.</p>