The triad of PHP, MySQL, and the Apache web server is one of the most popular web development platforms. There are several good reasons for PHP’s popularity as a web scripting language: it is easy to include PHP scripts in HTML documents, PHP is free in a monetary and open source sense, it has over a hundred function libraries, and it shares syntax with C or Perl-like languages.
This chapter introduces you to building web database applications with PHP. To show PHP in action, we present a simple application: a wedding gift registry. The application shows how common database functions are used in practice, along with how to secure a system, pass data between scripts, and add login and logout features.
We introduce the following concepts in this chapter:
An introduction to the PHP language and a short guide to installing PHP on your platform
How common MySQL library functions are used to access the MySQL DBMS
How to handle MySQL DBMS errors, use include files to modularize code, and secure user data
How to write data to databases, manage sessions in applications, and control the web browser
Other resources for learning more about developing PHP and MySQL web database applications
Chapter 18 presents a complete reference to the PHP MySQL library functions.