PHP and MySQL

New: Visit my "PHP Musings" blog for more on the topic of PHP, MySQL, and related (and maybe unrelated) subjects.

PHP is a general-purpose, multi-platform scripting language optimized for use with web applications. MySQL is a multi-platform relational database management system. PHP includes many functions specifically for working hand-in-hand with MySQL; and as both are open-source programs, they are very popular for use in creating interactive web applications. As such, they have become my tools of choice for web programming.

Latest News from PHP.net

PHP 4.4.9 released! (2008-08-07)

The PHP development team would like to announce the immediate availability of PHP 4.4.9. It continues to improve the security and the stability of the 4.4 branch and all users are strongly encouraged to upgrade to it as soon as possible. This release wraps up all the outstanding patches for the PHP 4.4 series, and is therefore the last PHP 4.4 release.Security Enhancements and Fixes in PHP 4.4.9:Updated PCRE to version 7.7.Fixed overflow in memnstr().Fixed crash in imageloadfont when an invalid font is given.Fixed open_basedir handling issue in the curl extension.Fixed mbstring.func_overload set in .htaccess becomes global. For a full list of changes in PHP 4.4.9, see the ChangeLog. (more...)

PHP 5.3 alpha1 released! (2008-08-05)

The PHP development team is proud to announce the first alpha release of the upcoming minor version update of PHP. Windows binaries will be available starting with alpha2 (intermediate snapshots available at snaps.php.net). The new version PHP 5.3 is expected to improve stability and performance as well as add new language syntax and extensions. Several new features have already been documented in the official documentation, others are listed on the wiki in preparation of getting documented. Please also review the NEWS file.THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!The purpose of this alpha release is to encourage users to not only actively participate in identifying bugs, but also in ensuring that all new features or necessary backwards compatibility breaks are noted in the documentation. Please report any findings to the QA mailinglist or the bug tracker.There have been a great number of other additions and improvements, but here is a short overview of the most important changes:Namespaces (documentation maybe out dated)Late static binding and __callStaticLambda functions and closuresAddition of the intl, phar (phar is scheduled for some more work a head of alpha2), fileinfo and sqlite3 extensionsOptional cyclic garbage collectionOptional support for the MySQLnd replacement driver for libmysqlWindows older than Windows 2000 (Windows 98, NT4, etc.) are not supported anymore (details)New syntax features like NOWDOC, limited GOTO, ternary short cut "?:"Several under the hood changes also require in depth testing with existing applications to ensure that any backwards compatibility breaks are minimized. This is especially important for users that require the undocumented Zend engine multibyte support.The current release plan states that there will be alpha/beta/RC releases in 2-3 week intervals with an expected stable release of PHP 5.3 between mid September and mid October of 2008. (more...)

TestFest 2008 wrap-up (2008-08-04)

Overall 158 tests have been submitted as part of TestFest 2008 since the launch of the TestFest submission site by 30 different people from people all over the world. Actually this is not counting the various submissions by existing core developers, who also took this opportunity to add some more tests. This has actually increased total test coverage for ext/reflection, ext/dom and ext/exif by about 10% each. While the organization of the TestFest was a bit adhoc, there were numerous TestFest events in local user groups. So the number of people exposed to the PHP test framework is much greater. Hopefully this will lead to more people submitting bug reports with an accompanying phpt test file!Our top submitter Felix De Vliegher has actually committed his last submissions himself since, based on the high quality of his submissions, he has been granted commit rights to the PHP repository. We have not heard back from all participants, but we encourage everybody to blog about their experience and provide us with feedback on how to improve future events.Now better late than never, here are the 10 winners of the promised elePHPant raffle sponsored by Nexen. Note that Felix asked me not to include him in the raffle, since he is already herding quite a number of elePHPants at home.Eric StewartHåvard EideMarc VeldmanMichelangelo van DamRein VeltRob YoungSami GreenburySebastian DeutschSebastian SchürmannStefan KoopmanschapWe will provide Nexen with the email addresses of the winners, so that they can arrange to get the elePHPants shipped. Also for those people wondering, you can continue to submit tests on the TestFest submission site. A bit thank you to all participants and TestFest organizers! Without the countless people that helped organize local events, implement the infrastructure and submissions reviewers, the TestFest would have obviously not worked out as well as it has. We will surely do similar events in the future based on the big success of TestFest 2008. (more...)

Articles and Scripts

The following are a few articles/scripts I've cobbled together at one point or another regarding common issues in the use of these tools:

Links

Here are a few links to on-line references and sources which I frequently use:

Forcing a File Download

This is just a little tip I picked up at the PHPBuilder.com forum to ensure that a file is presented for downloading rather than being automatically opened by a browser.

<?php
header('Content-Length: '.$fileSize);
header('Content-Type: '.$mimeType);
header('Content-Disposition: attachment; filename="'.$fileName.'"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');