MT+MySQL·PHP: 02 (Why MySQL and PHP?)
It occurred to me that before I cover phpMyAdmin and .htaccess security it might be useful to explain why I’ve decided to migrate my MT blog from the Berkeley DB database and HTML pages to MySQL and PHP pages.
Some of the advantages of using MySQL with MT are listed in this thread on the MT Support Forum. The main ones are:
- You can use MySQL Dump to quickly and easily back up your weblog data.
- Because MySQL is so widely supported, future enhancements to MT itself are likely to take advantage of the MySQL environment.
- Smart MT users will learn how to program directly to the MySQL database, thereby creating add-ons that enhance MT’s functionality.
- You will be less likely to encounter problems with database corruption due to diskspace limits.
Mena Trott sums it up like this:
If your webhosting account provides MySQL and has DBD::mysql installed, then I would say go with this version.
One significant advantage not mentioned in that thread is something for which MySQL is renowned: speed. I’ll let Mark Pilgrim explain:
I had previously complained that MT-Search was too slow searching my 900+ entries, but all performance problems have been magically resolved after upgrading to Movable Type 2.2 and MySQL. This also solves the problem of the “Google gap” (which Simon rightly complained about), whereby content would fall off the home page and disappear into the ether for three weeks until Google got around to reindexing it.
As for PHP, the main reason is that I have a strong preference for server-side programming languages. I know how to build dynamic Web applications with ColdFusion and (to a lesser extent) Microsoft’s Active Server Pages (ASP). PHP is an extremely popular, open-source alternative that is available for most flavors of UNIX as well as Windows NT/2000/XP. This page, which lists 7 Reasons Why PHP is Better than ASP does a good job of explaining PHP’s advantages. In a nutshell, PHP is fast, free, portable, and tightly integrated with MySQL. And it’s very popular with MT users (such as ScriptyGoddess).
What kinds of things can you do with PHP? Well, top of my list is replacing the monthly calendar with a random image. Next is to use PHP instead of JavaScript to generate the alternating white and gray backgrounds in my comments window. And, once I get the hang of integrating PHP code with my MT templates, I’m sure I’ll find lots of other features to add. So even though I don’t have any great desire to be a PHP programmer—my main focus is writing—I’m geeky enough to want to take advantage of at least some of the cool PHP stuff out there.
