O'Reilly logo

Managing & Using MySQL, 2nd Edition by Hugh E. Williams, Randy Yarger, George Reese, Tim King

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. PHP

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required