Chapter 9. CGI Programming

Including a section on CGI within a book about databases may seem a bit like having a chapter on automotive repair in a cookbook: sure, you need a running car to go to the grocery, but isn’t it a bit out of place? While it is true that the whole of CGI and web programming in general is vastly out of the scope of this book, a short primer is all that is needed to extend the capabilities of MySQL and mSQL to the high-visibility realm of the World Wide Web.

This chapter is primarily intended for those people who want to learn about databases but would not mind trying a little web programming. If your last name is Berners-Lee or Andressen you probably will not find anything here you do not already know. Even if you are not new to the world of CGI, it could be useful to keep a short reference handy while you ponder the mysteries of MySQL and mSQL.

What Is CGI?

As with most names that have acronyms, Common Gateway Interface ( CGI) tells us very little about what it really means. What are we interfacing with? Where is this gateway? What’s so common about it anyway? To answer these questions, we need to take a step back and look at the World Wide Web as a whole.

Tim Berners-Lee, a physicist at CERN, invented the web in 1990 (with planning going as far back as 1988). The idea was to give particle physicists the ability to exchange multimedia information—text, graphics, sounds—quickly and easily over the Internet. The World Wide Web had three major components: HTML, ...

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.