Jump to content

[SOLVED] limit sql results


mpharo

Recommended Posts

hello,

 

I am working on a site to display thousands of results....I have all of that working but I want to limit the results to 50 at a time...any suggestions on how to browse the results with a limit of 50....I am thinking about checking the value of a number and while it is less than the total count of rows in the query increment it by 50....if anyone has a snippet it would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/47289-solved-limit-sql-results/
Share on other sites

You need to look into "pagination". Unless you just want 50 results...then just put this code in your query.

 

$query = mysql_query("SELECT col1 FROM table WHERE condition LIMIT 50");

 

That would ONLY give you 50 results...but I think you are wanting pagination. PHPfreaks has a good tutorial on that.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.