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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:41:35+00:00 2026-05-19T09:41:35+00:00

I would like to limit the results from mysql query submitted by users. Currently

  • 0

I would like to limit the results from mysql query submitted by users.
Currently I am just parsing query string by PHP then appending LIMIT in the end.
For more complex queries with many nested selects/joins the things are becoming complex and less predictable.
Are there common way to force mysql to return only limited results even if user has asking for full set?

Thanks
Arman

  • 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-19T09:41:36+00:00Added an answer on May 19, 2026 at 9:41 am

    You are asking for some server configuration settings to limit the maximum number of rows returned by all queries. That is, select * from mytable will return maximum x number (x is set in global server configuration) or rows even there are many more rows in the table.

    Unfortunately, this is not possible in standard distributions of MySQL. You can set limits on maximum queries per hour, even what operations a user can do in server. But, limit of number of rows in query result cannot be set globally.

    However, you can get the MySQL community edition source code and add a configuration for global query result limit.
    Also, if you are using some kind of connector to connect to MySQL (for example, if you are connecting to MySQL from .NET), you can leave the server as is but modify the connector code and add your desired limiting configuration option there.

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

Sidebar

Related Questions

I'm using PHP/MySQL to make a website that displays race results. I want to
Please note that this question is not about the mysql query per se, but
Please note that this question is not about the mysql query per se, but
I have the following MySQL query, and I'm trying to adjust it so it
I am doing a query on an mysql database based on typed data sent
I am new to the whole php/mysql thing. I have a weeks worth of
I am building a search page, each page featuring 10 results. For that purpose,
I have a query that attempts to find things within a certain geolocation, but
I have a table articles , with fields id , rating (an integer from
I have a searchfield which allows a member to enter a portion of a

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.