Web Database Applications

with PHP & MySQL, 2nd Edition


Justin Williams Skip to comments 1 Comment (Comments Closed Closed)

After his first review, the authors of Web Databse Applications sent Justin Williams the latest revision to see if it solved his complaints with the initial edition. Find out what he thinks of it.

A few months back I reviewed the first edition of Hugh E. Williams and David Lane's book. A few weeks after the review, the author sent me an e-mail asking if I'd like to take a look at the newest edition, thinking that it had solved most of my criticisms of the previous version, which I enjoyed.

PHP is a scripting language for the Web and is seen as an alternative to Microsoft's Active Server Pages and to Java's JSP pages. Since the last review, PHP 5 was released offering a new object model for object oriented programming, refined XML support, enhanced support for Web services, built in SQLite support and tons more. While not used on many production servers yet, it is gaining acceptance. I was pleased to find that the 2nd edition of the book gave an introduction to PHP 5.

Comparing just the exterior of both books, I noticed right away that the 2nd edition is substantially thicker: almost 250 pages more. They really added a lot of material! New chapters include two chapters on Object Oriented Programming in PHP 5, using the , a chapter on common PHP errors and how to create custom error handlers, creating pdf reports using R&OS Ltd's PHP PDF library, installation guides for Windows and MacOS X and an appendix on the improved MySQL library found in PHP 5.

Like before, the book assumes you have some programming knowledge and then builds a basic foundation of PHP and MySQL knowledge. It is in no way a comprehensive guide to either, but it is not intended to be. It gives you enough ammo to get your feet wet in combining the two technologies, however.

One thing I enjoyed about the second edition is that it would always explicitly point out where a feature would be PHP 5 only or improved upon in version 5. For those cutting edge enough to have installed PHP 5 on their Mac, it gives them a very clear understanding and head start on using new technologies to be more efficient with your coding.

The Chapter on PEAR introduced templating, which was one of my gripes of the first edition. If you remember, the case study in the first edition did not use any sort of templating engine making customization of the layout difficult and tedious. While, this chapter introduces the PEAR modules for Integrated Templates, I would have preferred Smarty. Why? Most Web applications I am interested in using take advantage of Smarty. MovableType 3.1, for example, uses Smarty to take care of its dynamic publishing. For someone looking to build their own system from scratch, however, IT is a fine choice.

The chapter on common PHP errors is useful for the novice programmer. For someone that is a seasoned developer, it may not prove to be too useful. It explains common and not so common errors you may receive when your code doesn't function as it should. The information on custom error handlers is excellent. It gives you a starting point to write your own error handler or to just use the one created in the book. Kudos to the author on that one.

Reporting is another chapter that I was pleasantly surprised to see. The chapter walks the you through parsing your mySQL database and outputting the results into a PDF document. Why is this useful? Invoices. If you are creating an online shopping cart, your users will probably want a receipt. Telling them they can download a PDF receipt to keep in their records is very user friendly.

The final chapters of the book walk you through Hugh & Dave's Online Wine Store giving you an overview of what each bit of code takes does. The second edition of the Wine Store case study takes into account all of the new technologies you learned in the previous chapters such as templating, error handlers, sessions, etc.

Of interest to me was the appendix on installing PHP and Apache on MacOS X. The book tells you to use Marc Liyanage's PHP packages as a simple way of installing the latest version, and I couldn't agree more. I noticed when I was trying to get PEAR running that Panther has a broken installation. I consulted the book, and there were detailed instructions on how to get it up and running. I am really glad that the authors went the extra mile to accommodate Mac users as well as Windows users instead of just the customary Linux crowd.

Overall, I am really glad I got to take a look at the second edition of the book. Its new chapters were well written and gave a great overview to the seasoned programmer. Like before, I wouldn't recommend the book for a novice programmer. Williams and Lane do not do much hand holding like an "Introduction" book would. I appreciate that fact, but someone who picks up the book expecting to learn the basics from scratch may be disappointed. The only thing I would hope was improved upon in the book was an introduction to using Smarty templates and possibly some more advanced topics such as writing PEAR modules.

Book Details

Title: Web Database Applications With PHP & mySQL, 2nd Edition
Author: Hugh E. Williams & David Lane
Date Published: May 2004
ISBN: 0596005431
Buy It Online: Amazon

Justin WilliamsJustin Williams is founder and chief author for MacZealots. He switched to the Mac almost five years ago hasn't looked back since. When not blogging or coding, you can find him watching copious amounts of TV. Justin can be reached at

Reader Comments (1)

DISCLAIMER: The views expressed below are those of their authors and not necessarily endorsed or supported by MacZealots.com. In all cases, the comments provided here are offered as a courtesy and will be moderated. Any content deemed off-topic or offensive will be removed without notice. Posting a comment here boils down to two things: 1.) Think before you type 2.) Respect the thoughts of others. See our commenting guidelines and/or privacy policy for more information.

1 John Blaze remarks:
#1) On October 15, 2004 12:08 PM

What does everybody seem to be on MySQL’s jock? The licensing has changed as of version 4, thus for business use you must have ‘business license’ or all of your code must be apart of the LGPL. Not knowing any better, I too started down the MySQL path.

But guess what? PostgreSQL is better and is apart of the BSD license (Free as in Beer) It’s been voted database of the year 3 straight time by Linux and BSD user’s… (5 out of last 6 years).

http://postgresql.org