Reply to Re: [PHP] Creating a varable with a name held in a string

Your name:

Reply:


Posted by Richard Lynch on 02/11/05 19:12

Ben Edwards (lists) wrote:
> I have the following code;_
>
> $sql = "select * from text where id = '$id' ";
>
> $row = fetch_row_row( $sql, $db );

You may also wish to consider:
list($img_loc, $text_type, $seq, $rec_type, $section, $code, $repeat,
$description, $text) = fetch_row_row($sql, $db);

This allows you to see more of the code's algorithm (if/else/while)
on-screen.

A good editor should allow you to not "wrap" this line and clutter up your
screen. Or just buy a wider monitor :-)

This is a Religious Issue of Programming :-)

PS Using select * is also dangerous as you never know when somebody will
decide to add a new column in the database somewhere -- possibly one with
a *TON* of data that you don't need. Better to name each field you want.

--
Like Music?
http://l-i-e.com/artists.htm

[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

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