Book review: PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, 4th Edition by Larry Ullman

I bought PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition) to use as a set book for an online intermediate PHP class that I teach. I previously used Web Database Applications with PHP & MySQL by Williams and Lane, but it was very old (published 2004), covering only PHP 4, and no new edition seemed to be forthcoming. I chose Larry Ullman’s book pre-publication on the strength of the coverage described in the pre-release table of contents, reviews of earlier editions, and other books by Ullman which do a good job of explaining concepts — I also corresponded with the author about some of the details, and he was helpful and forthcoming.

I think this book will be much more accessible than the Williams and Lane one, which had great detailed coverage of PHP and MySQL, but was over-complicated in places. But I’m a little disappointed with several aspects.

By far the biggest disappointment: no coverage of exceptions, a key feature of PHP5. Second biggest: the whole chapter on OOP is pretty inadequate. I don’t teach OOP on my course, but I do encourage students to use pre-built classes for some tasks, such as data validation or sending mail. This chapter takes that approach, but doesn’t explain why using the MySQLi class is any better than just using the non-OOP mysqli_ functions. He could at least have covered PDO here, as it’s more versatile than MySQLi. But again, PDO isn’t mentioned at all — a very surprising omission.

I was also disappointed that while he briefly discusses user-defined functions in the early chapters, he makes no effort to encourage the reader to actually use them in the exercises and case-studies later in the book. All the code is inline, including in places that are crying out for use of functions, such as the shopping cart, user registration, and forum examples. This book is not intended for complete beginners, so it really should do more to encourage good practice and maintainable code. It is nice to include a chapter on using jQuery and AJAX with PHP, but frankly I’d have rather seen this chapter omitted in favour of more coverage of the above topics. I know there’s only so much you can cover in 600 pages (especially when the layout is so inefficient), and different readers’ needs will vary, but some of the priorities here seem wrong to me.

Good points: the coverage of MySQL queries is pretty good, but for my purposes I’d have liked to see better discussion and explanation of database design and ERDs. The Williams and Lane book had a very good appendix covering this. There’s a whole chapter on security, with useful and realistic examples, and Ullman addresses security aspects such as input filtering and escaping throughout the book (often a weak point in introductory PHP books, happily littered with examples using unfiltered POST and GET input “for clarity” — the ever-popular PHP and MySQL Web Development by Welling and Thompson is an egregious example). Finally, he does a good job of building up examples and leading the reader through them. The chapter on form handling is particularly good, and there’s also a whole chapter on regular expressions which does a better job than most of demystifying them. If you are an intermediate PHP coder, you’ll probably find this book useful to improve your skills, and I’m glad to find an up-to-date PHP book I can use for my course. But I’m still looking for the perfect intermediate PHP book!

One last black mark for Peachpit: the 2-column layout really doesn’t work for this material. Code listings drag on for pages because they are squashed into a narrow column, and the whole thibg looks untidy. Why they didn’t use a single-column design is beyond me.

This entry was posted in Databases, PHP, Web development and tagged . Bookmark the permalink.

2 Responses to Book review: PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, 4th Edition by Larry Ullman

  1. Brian says:

    Larry Ullman is the best technical author I have read for PHP (and other technologies). He is working on the third edition of his more advanced PHP 5 book that may supplement the weaker points you mention above.

    I too would like to more extensive use of PDO and OOP.

    Good luck with your teachings!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>