Web development

All about everyone's favorite pseudo-platform, the World Wide Web.

Simplifying SQL

Submitted by Larry on 22 October 2006 - 9:58pm

Most PHP applications do fundamentally the same thing: Shuffle data from an SQL database to a web page and back again. The details vary with the application, but in general that's what most web apps do. That very quickly runs into the bane of most PHP developers' lives: SQL syntax.

It's not SQL syntax itself that is bad per se. The problem is that it is a string-serialized format, which means you have to take your nice clean data structures and serialize them out into a string that has no semantic meaning to your PHP application. That's boring, dull, and introduces all sorts of places to totally mess up your application with a typo, and that's without even touching on issues of security. And then there are the issues with SQL syntax itself, in particular the way in which INSERT and UPDATE statements, which seem like they should be similar, have no similarity whatsoever. That makes "replace" operations (insert if new or update if not) very tedious to write, particularly if you have a lot of fields.

Fortunately, with a little ingenuity and help from PHP's array handling, we can give ourselves a common syntax for INSERT and UPDATE operations that maintains semantic meaning, and then get DELETE statements free of charge. Let's see how.

Shared web hosting: Where is open source?

Submitted by Larry on 1 September 2005 - 12:53am

In an earlier post, I mentioned some research I'd been doing with regards to Linux-based server software. To be more specific, I was investigating shared web hosting control panels. Most any web hosting service you find offers a web-based control panel. Generally such a system allows each user to manage their domain information, files, mail accounts, FTP accounts, and other such common features, and allows the admin to manage different user and reseller accounts. Some users get access to run web scripts, some don't, some have more disk space than others, etc. Some require specific underlying server software (a specific Apache version, postfix vs. qmail for email, etc.), others support a variety of alternatives.

It's the community, stupid!

Submitted by Larry on 18 July 2005 - 7:58am

In recent weeks I've been looking into a few open source Content Management System (CMS) projects. My initial interest was not, actually, in using a CMS but in finding one to dissect in order to get a better feel for building large, plugin-based application frameworks. There is a severe lack of documentation on plugin-based frameworks in general, so in true open source fashion the next step for me was "Use the Source, Luke!"

I only looked at a few, really, before I stumbled across Drupal. (To be fair, it had been recommended to me by a friend and fellow blogger.)