Building Database Applications on the Web Using PHP3
Authors: Craig Hilton and Jeff Willis
Publisher: Addison-Wesley
Price: $39.95 US
ISBN: 0-201-65771-6
Reviewer: Gaelyne R. Gasson
This book begins with an upbeat preface about PHP3's ease of use for web applications. We're told it “emphasizes applications using PostgreSQL and MySQL, two powerful database management systems”. The preface suggests taking a 30-minute “test drive” on the book's accompanying web site; unfortunately, the site wasn't available as of this writing. A note indicated they had a hard drive crash and were rebuilding the system. [The site has since been restored, and everything works except the login. —Editor]
The first chapter is an overview of the book. Chapters 2 through 11 are referred to as background information relating to web-based technologies. Sample applications comprise Chapter 12, followed by a few pages of technical notes in Chapter 13. The reader is only one-third of the way through the book at this point and may be startled to find that a sixteen-page index for the PHP3 Language and a Function Reference make up the bulk of the remaining pages.
Two appendices are included. The first deals with CGI variables; the second concerns timing comparisons between MySQL and two different configurations of PostgreSQL. The reading list doesn't specifically deal with PHP, PostgreSQL or MySQL. The references listed are excellent material for general programming and web development, but the list is broad rather than specific to the topic of the book itself. There are two additional indexes in the back: one for alphabetically listed PHP3 functions and another for the book itself.
A CD-ROM with PHP3, PostgreSQL, the latest GPL version of MySQL, various RFC text files and W3C's HTML 3.2, 4.0 and CSS2 specifications comes with the book. According to a list in Chapter 1, the CD should also contain “all code built in this book”, but that wasn't the case. To be fair, the CD does include the full source for every version of PHP from v2.0 through v3.0.12 in tar.gz format and several Linux Red Hat RPMs for both PHP and PostgreSQL. It also has the PHP3 manual in several formats.
Generally, you would expect to read a discussion on the choice of operating system before reading about how to install software. However, UNIX (and more specifically, Linux) is covered briefly in chapter 7, “Why UNIX (Why not Windows?)”, while Chapter 1 describes how to install the supplied software from the CD.
Chapter 2 discusses PHP, and the next chapter offers a look at databases, SQL and PHP. This is followed by a brief chapter about UNIX (and Linux) and then a discussion of Internet and browser basics. Logically, one would have expected the flow to have been UNIX first (if at all), followed by Internet and browser basics, HTML, PHP and then databases.
The PostgreSQL chapter includes a chart comparing its features with other databases such as Oracle 8, Sybase 11 and MiniSQL. Strangely, the chart doesn't make any references to MySQL. The chapter also contains examples showing the syntax for connecting to a PostgreSQL database using PHP3 and how inserts and selections are made.
The chapter on MySQL seems to be missing some information. Instead of following the same pattern as the previous chapter, readers are given three short paragraphs about the history of MySQL and seven paragraphs discussing speed differences compared to PostgreSQL. If this were the beginning of the MySQL chapter and it carried on to cover connecting to MySQL databases and other MySQL information in a format similar to that of the PostgreSQL chapter, all would be well, but it's only a brief description of the software speed. Not even a look into the format of commands is offered. This wouldn't be an issue, except the preface of the book says it “emphasizes applications using PostgreSQL and MySQL.” Both database types should have been given the same type of coverage. As it is, MySQL could well have been “swept into” the short (three-page) Chapter 6, “Other SQL Databases”.
The PHP3 Language chapter is fairly detailed and uses several examples. Many of these contain humour to help teach functions and how they're used. The example used for classes was the most memorable for its humour. I found this chapter most informative, but wish more time had been spent on how classes are used in real-world applications.
Chapter 11 comes back to a fuller discussion of databases and SQL, as well as database design. There seems to be only brief coverage of column (field) types such as string, numeric, date, etc. used in databases, although each type is mentioned within the scope of examples given. A beginner's book on building database applications should have more information on this topic in order to explain the pros and cons for some of the more common choices available. I expected to see the examples in the format of PostgreSQL first, followed by MySQL to show similarities and important differences between the two types of databases, but this wasn't the case.
The applications include Hello World, File-Based Counter, Data-Based Counter, Real-Time Graphics, Jeff's Super Form (a web-to-e-mail form), Specific Form Processor (a web-to-e-mail form that stores information in a database), Querying Application and Login Authentication (in which users allowed to access a page are stored in a database).
The application section had numerous typos that hopefully will be removed in the next edition of the book. Moderately experienced readers should be able to catch most errors, but inexperienced users might not. For example, the text discussing the second application uses a different variable than was used in the “Complete Code” listing—$counter mysteriously changes to $tcounter two pages after the complete listing.
The Real Time Graphics application shows how to build a runtime graphic “button” using text based on the user's input. However, it's not fully explained that in order for this code to work, there must be an existing graphic (“image/logo1.gif”). Perhaps the authors assumed the code (and graphic) would be included on the CD. Once a suitable image file was mustered, the example code worked as described. Beginners may find this frustrating and give up before going further.
Again, all of the database applications are listed using PostgreSQL exclusively. This could be forgiven if the front of the book had listed only the one type of database. Trying to use the examples as given require numerous modifications when used with MySQL.
After each application, in a segment labeled “Troubleshooting”, readers are told “What can go wrong? About a million things” and “try your application directly on the Readers Only PHP3 Web Site”. The same paragraph is repeated word-for-word between each application. A short list of the most common types of errors would have been more appropriate.
The bulk of the book is the “Language and Function Reference for PHP3”, and as stated in the preface, this section isn't a repeat of the PHP3 manual. Items are listed by functional category, and each item includes a short example on how to use it. Where required, further information on the item is given in a clearly boxed area. It provides a convenient off-line reference for PHP3, and seems to have had a great deal of time and effort put into it.
Building Database Applications on the Web Using PHP3 doesn't live up to its title. It is a reasonable PHP3 reference, and it's nice to have this in a printed format. The writing style used is upbeat and pleasant, and the segments that cover detailed information are clear and understandable. The problem lies in the organization of the book, numerous typos and missing details.

Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- A Topic for Discussion - Open Source Feature-Richness?
- What's the tweeting protocol?
- Dart: a New Web Programming Experience
- Developer Poll
- Trying to Tame the Tablet
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




2 hours 28 min ago
5 hours 54 sec ago
6 hours 18 min ago
6 hours 53 min ago
7 hours 15 min ago
12 hours 3 min ago
12 hours 50 min ago
14 hours 24 min ago
16 hours 1 min ago
17 hours 59 min ago