Reply to Re: Retrieve One Row Of MySQL

Your name:

Reply:


Posted by Claudio Corlatti on 10/11/07 17:44

On 3 oct, 21:09, a...@spamcop.net (axlq) wrote:
> In article <1191424134.543150.96...@o80g2000hse.googlegroups.com>,
> Claudio Corlatti <corla...@gmail.com> wrote:
>
> >well i didn't understand your question very well, but i suppose that
> >you want to obtain just one row from the table "colors".
>
> >to do that you need to add a "where" clause in your mysql query, for
> >instance "select * from colors where idColor=1"
>
> That will work, but a LIMIT should also be specified for efficiency.
> The query "SELECT * FROM MyColorTable WHERE ColorID=26 LIMIT 1" will
> cause MySQL to stop searching the table as soon as one row is found.
> Otherwise it will keep searching for other rows with ColorID=26.
>
> -A

yes, you are right the limit function is the best option in this case.

[Back to original 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

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