Reply to Re: am I doing unnecessary operations by mysql_fetch_array?

Your name:

Reply:


Posted by C. on 08/02/07 11:53

On 2 Aug, 10:04, Michael Fesser <neti...@gmx.de> wrote:

> >if so, can I simply return $row; ---because
> >'user_name' is the only field being selected.
>
> > $sql_query = "SELECT * from `user` WHERE (id = '$id')"; // (1)
>
> You shouldn't use "SELECT *" in production code, list all columns
> explicitly.
>
> Micha

You shouldn't use "SELECT *" in production code IF YOU CAN list all
columns
explicitly.

....reason being that you're loading more data into the mysql buffer
than you need, then it gets copied into the PHP variable space.

> (1), do I get some better performance theoretically?

Unless someone shoves a LOB column type and populates it, you're
unlikely to see much of a performance difference though.

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

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