I think this should be a good lesson for everyone: don't post code without testing it.
There's another point here, though. It seems that you're learning PHP (although in your "About" page you claim that it's one of your skills) so there's no shame in getting things wrong, but aside from learning that you really do need to test even apparently trivial things, it's also good practice to acknowledge other people's contributions, even if only by saying "My thanks to those who pointed out errors in the original." I wouldn't want explicit credit by name, but acknowledging other people is good practice. Look at PG's essays - he regularly thanks people for their feedback.