You are here: Re: am I doing unnecessary operations by mysql_fetch_array? « PHP Programming Language « IT news, forums, messages
Re: am I doing unnecessary operations by mysql_fetch_array?

Posted by Paul Lautman on 08/04/07 14:46

David Gillen wrote:
> Michael Fesser said:
>> Explicitly listing all columns in the SELECT statement works
>> always.
>>
> So does SELECT * if you code for it.
>
> $sql = "SELECT * FROM table1";
> $query = mysql_query($sql);
> while($row = mysql_fetch_assoc($query))
> {
> echo "Always field 1: " . $row['field1'];
> }
>
> So now, where is the problem?
>
> D.

As I said earlier, the problem is when a TEXT BLOB or any other large field
is added to the database in future and then all * queries are pulling back
loads of data that is not required.

Argue all you like, but it is bad practice. I have come across lots of bad
programming which was fine for the original intention, but caused many
problems when the applications changed in later years. Had good practice
been followed there would have been no problem.

So you go and ignore all the good advice you want to and program as badly as
you wish. It's a fair bet that I'll never have to maintain your crap.

 

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

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