title: PHP MYSQL request through JQuery
body: <p>I have an image gallery, at the moment I limit the results to 10.</p>
  
  <p>What I'm trying to do, through jQuery, is on click of the 'Load more Results' button,
  Load the next 10 rows(images) in the database.</p>
  
  <p>at the moment I use a class query.php to make my query call, then in my index.php display the data in a foreach loop.</p>
  
  <p>I was thinking perhaps using the query string to change the limit to rows 10-20 on click but finding difficulty in this. </p>
  
  <p>Any help will be appreciated.</p>
  
  <p>class query.php</p>
  
  <pre><code>     public function Query($db_table, $limit) {
  
          $this-&gt;db_query = mysql_query("SELECT * FROM $db_table ORDER BY time DESC limit $limit");
  
          while($row = mysql_fetch_array($this-&gt;db_query)) {
              $rows[] = $row;
          }
          return $rows;
    }    
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>$lim = $_GET['limit'];
  $Results = $Database-&gt;Query('info',  $lim); 
      if(is_array($Results)) {?&gt;
     foreach ($Results as $Result) { 
    //echo results
  </code></pre>
  
  <p>jquery</p>
  
  <pre><code>$("#my_container").load("../lib/class.database.php?limit=10,20"  );
  </code></pre>
  
  <p>Kind regards, 
  Adam</p>