Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:08:58+00:00 2026-06-17T18:08:58+00:00

I want display data from mysql database like [Youtube][1] comment 10 comments ‘show more

  • 0

I want display data from mysql database like [Youtube][1] comment 10 comments ‘show more 10’ link … how I can get this ?

That is my code

$entities = mysql_query(“SELECT timestamp, username, message FROM comments WHERE page_name = ‘$message_page’ ORDER BY timestamp DESC”);

        if (mysql_num_rows($entities) ==0) {
            echo '<strong>No comment, yet.</strong>';
            } else {
        while ($entities_row = mysql_fetch_assoc($entities)) {
        $entities_timestamp = $entities_row['timestamp'];
        $entities_username = $entities_row['username'];
        $entities_message = $entities_row['message'];

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:08:59+00:00Added an answer on June 17, 2026 at 6:08 pm

    What query are you trying ?What have achieved so far?Mention it and it would be easy for others to help you!
    As far as your question goes,you will have to use limit in your SQL query and on click of show more will need to get the next batch of records using ajax

       "select * from table_name where (your condition) limit ".$offset.",".$limit.""
    

    Here,offset would be the starting point and limit would be the no of records to get.
    So,your offset first time would be 0 and limit would be 10.
    Next iteration(on clicking show more) it will be 10,10
    next 20,10 and so on

    your jquery function would look like this

        $("#idOfShowMore").live('click',function({               
          $.ajax({
            url: "php file with query to database",
            type: 'POST',
            data: {"limit":"limit is 10 in your case"},
            dataType : "text",
            success: function(returnData){
                //append the return data on success
            }
           });
         })
    

    Hope it helps 🙂
    Update
    SELECT timestamp, username, message FROM comments WHERE page_name = '$message_page' ORDER BY timestamp DESC limit 0,10
    Here,0 is the offset and 10 is the limit.This will get the first 10 records of returned by the query.Now you will have to increment your offset by the value of the limit,so do it like–>offset = offset+limit;(initialize offset to 0 first)
    Now next iteration your offset would be 10 and limit will remain 10 as you need to get 10 records at a time.Call the ajax function on click of your show more link.This should be it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display data from database in DataGridView...This is my code...Its not working...Can
I want to display data in my own format from Mysql database connecting through
I want display data from database in Listbox...Here is my code, It is not
I want to display data feed from an external database in a sidebar in
I'm trying to display data from a database and I want to know what
I want to pull data from a database to display into a ComboBox, and
I am trying to show the data coming from mysql database as a table
I am trying to display data from a mysql database on my server. I
I have multiple SharePoint lists and want to display data from them on to
On one of our Java application screens, we want to display data loaded from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.