Re: Is there a way to display data from database for Select Options in a form?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Grant wrote:
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.

by that argument your own children shouldn't be sent to
school; and rather than showing then the kitchen stove one should
stick them in the garden with lots of sticks and wait until they learn
how to make fire on their own. (ok that was just to make the point - by
no means am I trying to offend!)

granted that some background is needed to give context to the
rationale (of my point 1 above). although it's questionable as
to have useful the background info could be given the ammount of
peripheral knowledge is required to make sense of some of the issues.



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.

you don't really think I wrote that function for her do you?
hopefully Sue got that too. I saw her email, I had the file in question
close at hand, I cut/paste & hit send - done.

besides I doubt that this will be the last dynamic select box Sue will want
to create (assuming she stick with this kind of work).



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

which is no argument for poluting the public space with even more code of
that ilk.

be some best practices that I now stick to.  However, being told that I

ever heard of the concept of learning from _other_ peoples mistakes? ;-)

need to write reusable functions for iterating a resultset would've had
me running off to another scripting language in a heartbeat.

I'd did tell her she had to use a function - quite clearly she was offered
something that nobody disputes will work as far as it goes.


Tell people to aim higher, sure, but let them make their own mind up,

I said encourage - which is doen by example rather than with a proverbial stick.

make their own mistakes and learn from them. :)

yeah so if Sue speaks I'll listen - Sue you seem to have carte blanche to
rip me to shreds so what are you waiting for :-)



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?

I think I post enough stuff here to rule out major elitism.
the only real bar I would place is that people are making an effort to
research/investigate and document their problems before asking someone
here for a solution.

to be honest Sue's question was vague, contained 'many' implicits and
showed no indication of having researched the issue. but heck she's female
so I let it pass this time ;-)

the bar has nothing to do with skill and everything to do with effort.

Should PHP be made a language that only the experienced can get into?

no not at all - but I do feel that answers on mailing lists should
be quality controlled to some extent - that way more of the correct
assumptions and good practices get through to _us_ programmers.

the bar to entry is low with php - that doen't mean we should encourage
to stay at that low level once they are in. n'est pas?

That sounds like a policy that would only harm the PHP community.

indeed.


David

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux