1. User Avatar

    I’m… sorry, but your comment just has me absolutely baffled.  I honestly don’t know how to respond to it.

    The only thing I can assume is that you’re tripping up on the tl;dr of the article.  And yes, it’s extremely tl;dr, because that’s just how I write.  However, I’ve re-read this twice now since seeing your comment, and I can’t really see how this is ‘not clear’.  Maybe that’s my own failing (I’m notoriously bad at being able to assess the quality of my own writing), but considering that part of my professional career is having to write clearly, and my ability to do so is something that I have been praised on since high school…  hrm.

    I suppose I’m just confused because the vast majority of the words here are, in fact, telling people how and why.  It’s not lowest-common-denominator stuff, but then again it’s not supposed to be.  Nor is it really a step-by-step tutorial; it’s discussing three things that, I suppose, have more to do with the theory of programming rather than just the “now write x, now write y” of your average PHP tutorial.  The thing on multiple MySQL connections especially is reasonably ‘advanced’ as far as these things go (it’s about as complex resource management as you’re going to get in PHP).  Maybe the title is slightly misleading in that regard.

    Perhaps it would help if I knew what parts you were struggling on?  I suppose, to break it down, the first part (What It Is(n’t)) is discussing the difference between an interpreted language like PHP, a markup language like HTML, and a compiled language like C/++.

    The second part (Common Mistake #1: MySQL) is discussing how PHP handles connections to MySQL databases, and why your scripts will most likely die if you’re trying to run two scripts side-by-side that keep their data in separate databases.  I see this error a lot at CodeGrrl – usually people trying to run WordPress and a fanlisting script at the same time – and AFAIK I’m the only person there yet (or at least was at the time of initial writing) who’s ever answered why it happens rather than just providing the stock-standard solution (put both scripts in the same db).  If you’ve never encountered this error before, this section will make much more sense if you try the example code.  There’s no simple ‘fix’ to this, incidentally, because (oddly enough) there is no simple fix to this.  You either understand the problem or you don’t.

    The third section, Common Mistake #2: Redeclaring Variables, is talking about some general bad-form coding that I see everywhere.  In a nutshell, it is telling you that instead of doing this sort of thing:

    $myName = $array['myName'];

    print "$myName";

    You should suck it up, learn to code properly, and do this:

    print "$array[myName]";

    And then rabbits on for a bit about why doing the former will make all the cool kids laugh about you behind your back.  Like the previous two sections, it touches on the notion of resource/memory management in programming; something that is vital in ‘hard’ programming languages like C/++, but is often abused terribly in ‘soft’ languages like PHP.

    And finally, the fourth section (Tips and Tricks: Associative Arrays) is just telling people not to be scared of associative arrays.

    Does that clear things up a little?

    [b]Editblush.png/b] Incidentally, I fixed up the dead sk.fan link.  My bad for dropping a script in the middle of writing it…

Add Comment
auto insert line breaks
use log.code
use smilies
Verification
  • v-s.net v0.6 and all content (unless noted) © Dee.
  • sk.log v0.6 spat this out in 3.238 seconds.
  • 2 / 231,476
artistic-twobyfour