O'Reilly logo

Learning MySQL by Hugh E. Williams, Seyed M.M. Tahaghoghi

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 14. PHP

In Chapter 13, we discussed how the triad of MySQL, PHP, and the Apache web server is one of the most popular web development platforms. In this chapter, we introduce you to building web database applications for this platform. We cover the following topics:

  • An introduction to the PHP language

  • How the commonly used 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 and manage sessions in applications

PHP has a large set of libraries available that can be used for tasks as diverse as string manipulation, network communications, data compression, and disk access. We can only touch on some of these in this book; you’ll find the PHP manual and the resources listed at the end of this chapter invaluable as you learn more about the language.

Language Basics

This section is a short introduction to the basic syntax of PHP. If you’re familiar with high-level languages such as C, C++, Java, JavaScript, or Perl, then you’ll find PHP very easy to learn. PHP began its life as a simple, procedural language that was designed to be embedded into HTML pages, and that’s mostly what we focus on this chapter. More recently, it has become a full-fledged object oriented (OO) language that can be used for nonweb and cross-platform applications, including both scripts that run from the command-line and programs with graphical user interfaces (see the PHP-GTK web site, ...

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