Reply to Re: faster way to get from SQL database into array

Your name:

Reply:


Posted by C. on 12/12/06 13:05

Cleverbum@hotmail.com wrote:
> Toby Inkster wrote:
> > Rik wrote:
> >
> > > Indeed, or possibly check it first:
> > > $searchstring = md5(//something);
> > > $result = mysql_query("SELECT `textmd5` FROM `logs_full` WHERE `textmd5` =
> > > '{$searchstring}'");
> > > if(mysql_num_rows($result) < 1){
> > > //not in table logic..
> > > } else {
> > > //is in table logic..
> > > }
> >
> > As the OP said, he needs to check "hundreds of thousands" of md5 strings
> > -- using an SQL call for each one will slow him down.
>
> Hit the nail on the head.
>

PHP arrays are not particularly fast / efficient - particularly when
they get big. The fastest way to resolve two large lists like this is
to keep the "hundreds of thousands" of needles in a table as well as
the haystack and join the two in an SQL query (rDBMS are designed
specifically to do this kind of thing).

C.

[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

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