Web Database Applications

with PHP & MySQL


Justin Williams Skip to comments 0 Comments (Comments Disabled Disabled)

A book review covering Web Database Applications with PHP & MySQL. An inside look at how this book can teach you the basics of understanding and learning how to use PHP and mySQL to create sophisticate and powerful web database applications.

PHP is a scripting language for the Web and is seen as the free alternative to Microsoft's Active Server Pages. PHP (latest stable release 4.2) offers exceptional execution speed, ease of development and tons of possibility when put together with MySQL, a powerful database backend (think Filemaker on steroids).

I have not touched a bit of PHP code since I was a Sophomore in high school because I drifted from Web development entirely for the better part of four years. I was prompted to return to learning PHP by a desire to refresh my Web development skills.

The book description from Amazon states the following:

Web Database Applications with PHP and MySQL offers web developers a mixture of theoretical and practical information on creating web database applications. Using PHP, and MySQL, two open source technologies that are often combined to develop web applications, the book offers detailed information on designing relational databases and on web application architecture, both of which will be useful to readers who have never dealt with these issues before. The book also introduces Hugh and Dave's Online Wines, a complete (but fictional) online retail site that allows users to browse, search a database, add items to a shopping cart, manage their membership, and purchase wines. Using this site as an example, the book shows you how to implement searching and browsing, store user data, validate user input, manage transactions, and maintain security.

This book is not designed for someone that is totally new to programming. The first three chapters give you to the point histories of the Internet, an introduction to the PHP language and an introduction to SQL. I don't really think the history of the Internet was needed, as it didn't really teach me anything I didn't already know or would expect someone else picking up the book to know.

The next part of the book details the basic workings of a Web database application. Topics covered include querying a database, writing data to said database and user driven queries. Chapter six is the main meat giving the reader details how to insert, delete and update data to a MySQL database via PHP.

Part three of the book is the tedious parts of a Web database application. Validation of data, user sessions and authentication and security are topics each covered. The book does an excellent job explaining user sessions. The authors again do an excellent job of explaining several approaches to a solution and then providing each solution's advantages and disadvantages. I prefer this approach to the authors just sticking to one method because it lets me, as the reader choose the solution I think would be best for my situation. Variety is, after all, the spice of life.

The final part of the book goes in-depth into "Hugh and Dave's Online Wines" case study. The authors cover setting up the shopping cart, customer management and handling orders.

The appendices of the book are not that interesting to me. Being a Mac user, PHP and Apache were already installed, and MySQL is a simple pkg install. The second appendix covers HTTP in more detail than you may want to know. It is not the most comprehensive source I have ever read on the subject, but it gives you more information than just a brief overview.

Appendix C should have been pushed into a full chapter, I believe. Knowing how to design a relational database is essential to creating Web database applications. By putting the information in an Appendix, readers may consider it optional information they may not need. That is the furthest thing from the truth.

The final appendix covers session management from the database tier. Previously the session management information was done using PHP. The authors give their reasoning for why it is a good idea to do this in the database tier rather than the middle or client tier.

The authors provide all the source code covered in the book online to save readers from a lot of unncessary typing.

I liked this book in general. I liked the case study that continued from beginning to end. It definitely helped to push the information across in a real-world situation. With many books, you are just told why something is or how it is done. Williams and Lane take it a step further and give you a working example of how it is done so you can see for yourself how it works.

As I said above, the book isn't really geared towards someone with no programming experience. If you have had just a basic course in school in something like C or maybe even ASP, you will be fine. If you have no idea what the difference between a do while or a for loop is, you may want to find a basic book. For the PHP gurus, Web Database Applications is a great reference if you want to refamiliarize yourself with certain topics you may be rusty on. I keep it close by when I am working in PHP now. I have this book to thank for bringing me up to snuff with what has changed in the past four years since I did any PHP development.

If you are looking to get up to speed on developing on the Web using PHP and MySQL, I couldn't think of a better introduction to the topic than this book. A newer version was just released this month that includes info on using PEAR, more templating and introductions to PHP5 and MySQL 4.1. I give it four out of five Zealots.

Book Details

Title: Web Database Applications with PHP & MySQL
Authors: Hugh E. Williams & David Lane
Date Published: March 2002
ISBN: 0596000413
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