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 6059929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:46:02+00:00 2026-05-23T08:46:02+00:00

hello i’v built a search, using MySQL, PHP and jQuery, this is the search

  • 0

hello i’v built a search, using MySQL, PHP and jQuery,
this is the search query using Prepared Statement..

$sql = "SELECT singer_name FROM singers WHERE singer_name LIKE ? LIMIT 5";

now what i want to do is show only 5 results but i want to also show a button with the REST of the results
like when you search in facebook the show only 8 of the friends and then a button with “see more resutls for ? showing top 8 results”,

how do they do that ? , i’m sure it’s fairly simple..

  • 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-05-23T08:46:03+00:00Added an answer on May 23, 2026 at 8:46 am

    LIMIT has 2 parameters with which you can fetch range of results instead of just first 5.

    Check out an article on LIMIT

    Example,

    $sql = "SELECT singer_name FROM singers WHERE singer_name LIKE ? LIMIT 5, 5";

    The above SQL will retrieve results from 5 to 10.

    Update:

    If you want to show results like “showing first 5 out of 20” then you need to first count the total number of results then apply LIMITs.

    $sql = "SELECT COUNT(singer_name) FROM singers WHERE singer_name LIKE ?";

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

Sidebar

Related Questions

Hello I am using jQuery UI Accodions By default, the first accordion is shown
Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework
Hello again stackoverflow! So i build this script: <?php $xmlurl = 'http://api.ipinfodb.com/v2/ip_query.php?key=apikey&ip=127.0.0.100&timezone=false'; $xml =
Hello I am using jQuery cycle lite plugin (image rotator plugin) , and I
Hello I have this query... if (isset($_REQUEST['deletePost'])) { $q = $dbc -> prepare(DELETE FROM
Hello I'm trying to take backup from mysql command line client. I'm using mysqldump
Hello can anybody solve this please I'm creating the object in the action class
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello we have an SQL server application running over a low bandwith connection. We
Hello everyone i am trying to format the input number range with php number_format

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.