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

Posted by Jochem Maas on 01/10/06 19:15

Jay Paulson (CE CEN) wrote:
> [snip]Let's look at it another way, why 70-80 lines of code when 4 will do it
> properly when done correctly?[/snip]

4 * 20 = 80
so after having created 20 dynamic select boxes the function wins it.
I really don't think that performance here is the issue - one should tackle
that with suitable caching not writing unmanagable speed-freak-code.

on top of that there is a high chance that the 4 lines will be copy/pasted
quite often - a great way to replicate small little errors. in contrast to the
function which keeps the 'template' HMTL output (of the select box) in
a single place (handy for making site wide changes - for instance all a requirement
that means all selectboxes must have a certain class attribute value?)

another advantage of the function is that it takes into account
attributes/functionality that you might not need in this particular case now -
but might come in handy. using the function means not having to hack stuff
in later)

>
> I agree with this line of thinking especially for a new person to php.
>
> When I first read the solution that was so long I thought to myself "great and this person is new to php and now they are going to be scared of php."

Sue ....

DON'T PANIC (sorry for the lack of friendly letters)

(the fear argument doesn't wash with me btw; if Sue has more questions she should fire away!)
(with regard to fear: go read some Krishnamurti or have children or something - either you go
mad or you get over it ;-)

>
> I really think one of the appeals of php is it's simplicity of getting things done and getting those things done quickly.
>
> Yes it's great having one function to output every select html form but is it really necessary?

sheesh - it's not [YouMustBeJokingIfYouThinkDevelopingWithThisIs]QuickForm
(the 'YouMustBeJokingIfYouThinkDevelopingWithThisIs' is silent ;-)



>

 

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

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