Re: More frustration with MySQL and PHP
| From: | Daniel Brown | Date: | Tue, 22 Jan 2008 15:32:35 +0000 |
| Subject: | Re: More frustration with MySQL and PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267835@lists.php.net to get a copy of this message | ||
On Jan 22, 2008 9:03 AM, Eric Butera <eric.butera@gmail.com> wrote:
> That is basically it. You're going to want to learn the why, not just
> the how though. There is a reason for creating functions and it isn't
> just code reuse. Think about when you want to change your export
> script. Say you needed to add a field to it. Right now you have to
> edit some web facing php script mixed with code that handles the
> request and connects to your database. Wouldn't it be easier if you
> just could edit a very specific spot that was easy to get to and pop a
> column on to that instead of sifting through dozens of if statements?
Eric's exactly right, J. I started working with PHP about a
decade ago (yeah, I was one of the 1% or so that played around with
PHP/FI2 - and I still have a copy of it, actually). I really didn't
appreciate functions as much as I should have until the release of
PHP4, and like Eric said, it's not just for 'reusability' - it's also
for portability, centralization, extensibility, and a whole bunch of
other great words with expansive suffixes.
--
</Dan>
Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
Nineteen-Seventy-[mumble].