title: Load more in php mysql and jquery
body: <p>I am trying to provide option to load more post in php webpage for my school project.</p>
  
  <p><strong>Here are some of the php code.</strong></p>
  
  <pre><code>    &lt;?php
          $prj= mysql_query("select * from campaign where uid=$uid order by Closing_Date DESC Limit 0,1");
              $record = array();
              while($row = mysql_fetch_assoc($prj)){
              $record[] = $row;
              }
       foreach($record as $rec){
  
                  &lt;div class="col-sm-1 col-md-4" id="&lt;?php echo $rec['cid'];?&gt;"&gt;
                      &lt;div class="well"&gt;
                          &lt;div class="media services-wrap55 wow fadeInDown"&gt;
  
                                  &lt;h4 class="media-heading"&gt;&lt;?php echo $rec['Project_Name'];?&gt;&lt;/h4&gt;&lt;/a&gt;
                                  &lt;p&gt; by &lt;i&gt;&lt;?php echo $rec['user_name'];?&gt;&lt;/i&gt;&lt;/p&gt;
                                              &lt;p&gt; &lt;?php echo $rec['short_dis'];?&gt;&lt;/p&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
      ?&gt;
  
  &lt;?php } ?&gt;
  
  &lt;div class="col-sm-1 col-md-12"&gt;
      &lt;div class="media services-wrap55 wow fadeInDown"&gt; 
          &lt;center&gt;&lt;h3 class="media-heading"&gt;&lt;div class="more" id="more"&gt;Load More Post&lt;/div&gt;&lt;/h3&gt;&lt;/center&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Here is javascript code.</strong></p>
  
  <pre><code>$(document).ready(function(){   
      $('#more').click(function(){
  
          var get_last_post_display=$('li:last').attr('id'); //get ip last &lt;li&gt;
  
          $('#more').html('&lt;img src="ajax-loader.gif");
              $.ajax({                
                  type: "POST",
                  url: "more_prj.php",
                  data: "last_id_post="+get_last_post_display, //send id ip last &lt;li&gt; to more_post.php
                  cache: false,
                  success: function(html){
  
                      $('ul').append(html);
  
                      $('#more').text('Load More Project'); //add text "Load More Post" to button again
  
                      if(!html){
  
                      $('#more').text('No more Project to load'); // when last record add text "No more posts to load" to button.
                      }                   
                  }
                  });
          });                 
  });
  </code></pre>
  
  <p>I have problem while configuring javascript below code. 
  var get_last_post_display=$('li:last').attr('id');
  It is configured for <strong>li</strong>  and i want to configure it for <strong>div</strong>.
  I tried multiple times but no luck as i am not good with javascript.</p>
  
  <p>Can you please advise me how to configure it.</p>
  
  <p>Thanks.</p>