Cristian Darie has done it again!

Cristian Darie has done it again. The last book I had authored by him was Beginning ASP.NET 1.1 E-Commerce. It was a book which guided me from the introduction of three-tier programming all the way to the creation of a full-blown, feature packed e-commerce website using Microsoft’s ASP.NET Technologies.

This book, Beginning PHP 5 and MySQL E-Commerce was written with the similar concept in mind.

Very often, programmers are faced with situation where once the web application is fully developed, modifying or extending it in the near future is nothing but a nightmare! The solution? Three-Tier architecture! They are the presentation tier, business tier and the data tier. In this book, Christian Darie and his co-author Mihai Bucica, first introduces the reader into the world of three-tier architecture programming.

From there, the reader is given preliminary information such as the various technologies available for dynamic page creation and the different tools which the reader would expect to use during the course of the book such as PHP for dynamic web page generation and MySQL as the database management system.

One fundamental aspect of the book which I found rather interesting was the way the authors blended the different tools and programming language used to develop the e-commerce website with the context of the three-tier architecture as mentioned earlier.

The presentation tier here was presented with the a mix of both HTML and PHP. Instead of the confusing spaghetti code style where PHP coding is seen interleaved with HTML coding, Bucica and Darie introduced the idea of using Smarty Templates which is similar to Microsoft’s ASP.NET code-behind concept where the programming language is separated from the HTML code to improve code management and readability.

The online store’s business logic is then coded in PHP classes which represents the business tier of the architecture.

Then comes the third tier, also known as the data tier where the store’s data management resides. This tier is represented by MySQL. However in an effort to provide a systematic way in managing SQL coding, the authors followed the idea of using Stored Procedures which, at the time of writing was not a feature available with MySQL. As such, a plugin name PEAR DB was introduced to help facilitate the usage of stored procedures.

With such clear cut separation between HTML, PHP coding, business logic PHP classes, MySQL for data management and PEAR DB to manage SQL Queries (stored procedures) , managing, upgrading and maintaining the application from a coding perspective is simply a breeze.

When it comes to learning, there is nothing like practical, hands-on work and this is where this book excels in. After introducing readers to the concept of the three-tier architecture, readers are then brought through a step-by-step creation of a fictional online e-commerce store called the TShirtShop which comes complete with a shopping cart, web based administration system for the online store all the way to receiving online payments through various channels such PayPal and credit cards.

If these may scare you, fear not, the authors present coding in a clear, easy to understand manner with suggestion of best coding practices, code manageability alongside with self-explaining comments within each snippet of code.

Another advantage when using this book is the different stages in which the authors introduce various features to compliment to the site. After completing the first few chapters (chapters 1 through 9), you have a complete site which comes with shopping cart functionality, catalogue search and ability in receiving orders. Other functionalities which were also covered in the book such as implementing credit card transactions, customer product reviews, product recommendations and integration to various web services such as that of can be implemented on a needed basis.

As such, if you have preliminary knowledge on the PHP programming language and would like to have a feature packed e-commerce solution on an open source platform, this is certainly one of the best books I would recommend to anyone venturing into the world of e-commerce.

Leave a Reply