Wrapping Up My “Effortless E-Commerce with PHP and MySQL” Book

September 23, 2010

I’m very pleased to say that I’m in the process of wrapping up my next book, “Effortless E-Commerce with PHP and MySQL”. I’ve  completed the writing of all eleven chapters. Now I’m in the process of reviewing the PDF layouts of the chapters, which I’ll finish over the weekend (the book goes to the printer on Tuesday). Overall I think the book turned out quite well, although you’d expect me to say that! Unfortunately I did have to cut a couple of “bonus” chapters out, as I ran out of pages (the publisher institutes a hard limit on a book’s length), but I should be able to explain most of the bonus materials in blog postings here. I’ll post the final table of contents separately, and I still need to put the code for the second example online (actually, I need to create the official Web site for the book, too), but I wanted to quickly mention some of the book’s highlights, in no particular order:

  1. The book uses a free-flowing format. Most of the books I write are in Peachpit Press’s Visual QuickPro Guide or Visual QuickStart Guide series, which is fairly structured (two-column layout, etc.). This book is under the New Riders label, so it’s not pre-scripted in any way. This means that complicated bits of code get developed in a series of steps, with explanations; simple bits of code and very basic scripts just get presented in their entirety.
  2. There are two complete e-commerce example sites developed in the book. The two have very few overlapping features, so you’ll see lots of ways to do things. For example, how you perform MySQL queries using PHP is presented three different ways: the standard, direct method; using prepared statements; and using stored procedures. How to address the HTML-PHP relationship is also presented in two different ways. You’ll see how to do a site that requires registration and one that does not. You’ll manage inventory for physical products, create virtual content, setup repeating payments, and authorize credit card holds to be debited later. It’s very much a buffet of ideas, allowing you to pick and choose those you like best or are most appropriate for your e-commerce sites.
  3. You’ll get both the bigger picture (of the process, finding a host, developing a site, etc.) and lots of specific code and recommendations. The book teaches not just how to do things, but why you would want to do them this way or another way. In other words, there’s a larger proportion of theory discussed.
  4. Security is hammered constantly. The second chapter is all about security, from a general approach to preventing common attacks. All of the other chapters also use secure techniques but, just as importantly, indicate simple things you might casually have done, that have terrible security implications.
  5. The examples use third-party libraries for extra features. You’ll see how to integrate a WYSIWYG editor into a form so that an administrator can add HTML content. You’ll also apply three different, but simple, uses of the jQuery framework. And the Zend_Mail component of the Zend Framework is used so that an HTML or plain text version of an order receipt can be sent to the customer upon completing his or her order.
  6. Secure uploading of PDF and image files.
  7. The second e-commerce example uses an MVC (Model-View-Controller) approach to development, without tapping into a framework or requiring object-oriented programming. There’s a huge security and performance benefit by placing almost all of the database logic within the database (i.e., the Model). And all of the HTML is written into separate files (the View). The remaining PHP code (the Controller) is sparse and clean.
  8. I developed two versions of a really nice user-defined function for creating form elements, with the ability to handle both existing values (i.e., to make the form “sticky”) and error reporting.
  9. PHP’s relatively new Filter extension is used to validate many values.
  10. There are tons of recommendations for how you can modify and extend the examples. I think about half the chapters conclude with 3-5 pages of ideas, including that specific HTML, PHP, and MySQL, required to accomplish those alterations.

So there you have a somewhat random ten highlights of the book. Having written nearly 20 books over the past 10 years, over half of them involving PHP and MySQL in some capacity, I worry about giving readers something new and interesting. If you’re paying $20-30 for a book, you should feel like you’re not just getting a different wrapper on something I’ve already written. I think I really succeeded on that note here. And I hope you’ll feel the same.

My thanks, as always, to everyone who has provided feedback on this book idea and have expressed their interest in it. The book is currently listed at Amazon.com for $23.09 (the MSRP is $34.99). I’ll continue to post updates about its status here.