You are here: Re: [PHP] Is there a way to display data from database for Select Options in a form? « PHP « IT news, forums, messages
Re: [PHP] Is there a way to display data from database for Select Options in a form?

Posted by David Grant on 01/10/06 19:13

Jochem,

Jochem Maas wrote:
> David Grant wrote:
> 1. your looping a result set which involves a db connection - lots
> of pontential things that could go wrong...

Absolutely, and lots of lessons to learn too.

> 2. its not a centralized 'solution' - code reuse is a good thing.

However, what use is code reuse when you're using it only once. If you
need to perform the same function again, then refactor the existing code.

> 3. we should encourage people to aim a little higher?

I imagine my first PHP script with a database connection probably looked
much like Adrian's solution, and writing lots and lots of PHP has taught
be some best practices that I now stick to. However, being told that I
need to write reusable functions for iterating a resultset would've had
me running off to another scripting language in a heartbeat.

Tell people to aim higher, sure, but let them make their own mind up,
make their own mistakes and learn from them. :)

>>
>> Even the longest journeys start with small steps, and asking someone new
>> to PHP to separate various tiers might put them off.
>
> which I could spin as a positive thing - raising the lowest commom
> denominator
> so to speak. besides Sue was the one that came with the many-in-one
> question
> (i.e. how to a dynamically generate a select box AND how do I grab data
> from
> a DB).

I'm sure you're not being elitist, but where do you place the bar?
Should PHP be made a language that only the experienced can get into?
That sounds like a policy that would only harm the PHP community.

David
--
David Grant
http://www.grant.org.uk/

 

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

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