You are here: Re: better practice - php code or multiple mysql queries? « PHP Programming Language « IT news, forums, messages
Re: better practice - php code or multiple mysql queries?

Posted by Steve on 01/18/08 20:58

"The Natural Philosopher" <a@b.c> wrote in message
news:1200672543.35803.0@iris.uk.clara.net...

> I've done this.
>
> Itseasierto do one big query, sort by whatever, iterate through the array
> and write a new header everytime the name changes
>
> e.g. select surname,... from mytable, order by name gets the lot in teh
> write order, and then a simple loop with something like posting a varablee
> for the current first letter, and if it DIOES'T match the initial of the
> name you are about to print, executing a bit of code that prints a new
> header, aand set it to the current first name.
>
> PHP may be slow, but not as slow as the overhead on an SQL call with the
> attendant file system shuffling.

phil...i've never, ever seen *any* scripting language that can out-perform a
database. sorry, i don't buy that. that one (whatever is meant by that)sql
query can run cached and be optimized by almost any db. whatever system
shuffling is to be done, it certainly will be mechanically LESS than hitting
the db n times to get the same result...especially considering that php is
involved between calls rather than just one process.

make a believer of me, though, and i will happily change my mind. :)

 

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

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