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

  • Home
  • SEARCH
  • 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 8077977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:38:54+00:00 2026-06-05T15:38:54+00:00

I have an issue. I am getting data from a MySQL database, and make

  • 0

I have an issue. I am getting data from a MySQL database, and make a list of it. That’s all good, and works fine, but the list is now over 100 items long if I don’t limit it.
I’ve tried Googling how to shorten list, and found some things with jQuery and JavaScript, but that didn’t work too well.

What I’m looking for is a way to make the list limit itself on 10 items, with a [More] button under it. When pressed, the next 10 items show, and when pressed again, 10 more etc.

I have my list in normal <li> and <ul> bits.
If there’s any more information needed, please ask me. This is the webpage it’s about: http://lolmewn.nl/stats/

A bit of my PHP code:

echo "<li><a href=\"?player=" . $row['player'] . "\">" . $row['player'] . 
     "</a></li>\n";
  • 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-05T15:38:56+00:00Added an answer on June 5, 2026 at 3:38 pm

    Maybe you can try this. In this example I used 2 items instead of 10. I used css to hide all li elements starting from the 3rd li element inside the ul. I used jQuery to reveal additional 2 lis every time show more is clicked.

    Hope this helps

    Updated Link Again…

    EDIT

    $(function () {
        $('span').click(function () {
            $('#datalist li:hidden').slice(0, 2).show();
            if ($('#datalist li').length == $('#datalist li:visible').length) {
                $('span ').hide();
            }
        });
    });
    ul li:nth-child(n+3) {
        display:none;
    }
    ul li {
        border: 1px solid #aaa;
    }
    span {
        cursor: pointer;
        color: #f00;
    }
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <ul id="datalist">
      <li>dataset1</li>
      <li>dataset1</li>
      <li>dataset2</li>
      <li>dataset2</li>
      <li>dataset3</li>
      <li>dataset3</li>
      <li>dataset4</li>
      <li>dataset4</li>
      <li>dataset5</li>
      <li>dataset5</li>
    </ul>
    <span>readmore</span>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue getting data from three tables, which I want to return
I'm terribly bad at keeping MySQL queries straight, but that aside I have one
I have a small issue. I am trying to pull some data from my
I'm having an issue getting a LINQ query to work. I have this XML:
A common issue I have is getting confused what $(this) is referring to. I
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
i have an issue i could use some help with, i have python list
I'm getting an array of values back from a database where I get an
Not sure if anyone has experience this issue. I have a TextBox that I
In my application I have a datagrid that populates with info from a SQLserver

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.