[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

limiting rows

Posted on 2004-04-18
6
Medium Priority
?
293 Views
Last Modified: 2008-03-06
how can i limit rows while getting result from database?
0
Comment
Question by:abhishek2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 200 total points
ID: 10853363
The LIMIT clause may be used to limit the records returned by the SELECT statement. You specify the start row (start from zero), and the number of records returned. The following example lists the first 10 records from the search table.

SELECT * FROM search LIMIT 0, 10;

The following example would retrieve the next ten records from the table.
SELECT * FROM search LIMIT 10, 10;  
0
 
LVL 1

Expert Comment

by:drag0n
ID: 10855791
You can also store the start and end rows in variables to be able to produce the paging functions you see everywhere. You pass these variables in the url with strings for next, previous paging
0
 
LVL 7

Expert Comment

by:madwax
ID: 10867000
Repost from duplicate question:

Hi abhishek2002,

If you are using MySQL you can write

SELECT * FROM myTable LIMIT 0,10

where 0 is startrow and 10 is number of records you want to return

Read more: http://dev.mysql.com/doc/mysql/en/SELECT.html

//jan
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question