You are here: Re: Using MySQL, can I SELECT rows only within a certain range (ie. rows 11-20) « PHP Programming Language « IT news, forums, messages
Re: Using MySQL, can I SELECT rows only within a certain range (ie. rows 11-20)

Posted by Rik on 07/31/06 13:22

bizt wrote:
> Hi,
>
> I want to find an easy way to select only rows within a certain range
> when I do a select. Im sure I have seen this done with a SELECT
> statement but cant remember if or how it was done. Can someone help
> please.
>
> If not SELECT, whats the simplest way to do this? I have in the past
> selected all rows, and using a counter and conditional statement I
> will only output if within range
>
> //while shifting through the table select
> if (($i > 10) and ($i < 21))
> {
> //within range, output
> }
>
>
> Is this the simplest method? cheers

No.
Add " LIMIT 11, 10" to your query, and get only the rows you need. Check the
MySQL manual for the exact workings.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация