is and it worked to perfection! I also appreciate everyone else's
input. I was able to use this code snippet to do several things that
I ran into along the way, especially since most of the values that
are in the database I'm importing from are mostly logical (e.g. T,
F, 1, 0, etc.). I did not design it, though I am doing what I can to
extract what is in it and make it as readable as possible to users.
There was really not that much human readable versions of
information to pull out. This code helped tremendously by allowing
me to make sense of all of the logical values! Thanks again
everybody!
--- In [email protected], Ray <[EMAIL PROTECTED]> wrote:
>
> On 5/12/06, Pete <[EMAIL PROTECTED]> wrote:
> >
> > You should never hard code values into your program. What
happens when
> > someone decides to add a new meal, Dinner, for example? In the
case
> > above, all you have to do is add
> > "D", "Dinner"
> > into the database, no code changes required.
>
>
> Pete, I tend to agree with you there, but I would not go as far as
to say
> "never." If there's little chance that the hard-coded data will
change and
> the database needs to be kept as simple as possible, I'd find it
acceptable
> to handle the conversion in the program.
>
> One disadvantage of pulling the data from a table and just
throwing it on
> the screen without further processing is that you can't really
control the
> display anymore. If somebody introduces a new meal code like "Five-
course
> Fundraising Dinner", for instance, chances are that the
unexpectedly long
> string will screw up the entire page layout. Sure, it's an extreme
example
> and you can limit the field length in the table to prevent it, but
to cover
> every possibility that may come up in the future, even a simple
case like
> this can get complicated rather quickly...
>
> Cheers,
> Ray
>
>
> [Non-text portions of this message have been removed]
>
The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning.
YAHOO! GROUPS LINKS
- Visit your group "php_mysql" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
