UKUUG home

UKUUG

(the UK's Unix & Open Systems User Group)

Home

Events

About UKUUG

UKUUG Diary

Membership

Book Discounts

Other Discounts

Mailing lists

Sponsors

Newsletter

Consulting

 


 

Web Database Applications with PHP and MySQL Hugh E Williams and David Lane
Published by O'Reilly
ISBN:0596000413
582 pages
£ 31.95
Published: 4th April 2002
reviewed by Mike Smith
   in the May 2002 issue (pdf), (html)
bookcover  

The goals of this book appear to cover: PHP scripting, SQL, tiered application architectures, database design, security, TCP/IP, HTTP, HTML, templating systems and (it seems) how the Internet works. You're right - it doesn't say all that on the back cover, but that's the ground covered, and in doing so, it's covered pretty thinly.

Despite the title, there are also diversions into Oracle, ODBC and connectivity to other databases. We cover a myriad of topics, ranging from performing field validation and using PHP sessions to authentication and security. Then we spend four long chapters (100 pages) dissecting the case study (which we've dipped in and out of all the way along too.)

First, the bad news The first time we see a piece of PHP doing some MySQL functions is on Page 162. Excluding the Appendices, that's over a third of the way through the book - it therefore takes a long time to get into what I regarded as the core requirement of the text.

There is no coverage of database transactions (commit, rollback etc). This is commented on, and the reason cited is that it is of less interest in the stateless HTTP environment. True, maybe (and indeed if you are using a third party hoster, this is most likely to be the case). However I think it is important, as any reasonably sophisticated application - even a web application - is going to be updating multiple tables at some point. As soon as this happens there is the possibility of data integrity problems.

I also noticed some trivial PHP scripting and output formatting errors (eg missing semi-colon etc).

Try as I might, I couldn't get the online case study to work. Whether this was because the server was overloaded, the application was broken or the database had become so full of data that its performance had deteriorated to a halt (an application design issue in itself), I don't know. (Post Script: I've also had table locking errors now - definitely a poor advertisement for the book; and the code and techniques developed therein.)

Gems Okay enough criticisms - what did I find, which I found useful ?

This is the first O'Reilly book (that I have read, anyway) which covers PHP. (I'm excluding the PHP reference, which you don't need these days - just go to www.php.net !) It has an overview of multi-dimensional arrays and array functions, which I liked. It also explains automatic type conversion, the implications and pitfalls.

I've wondered how to integrate browser authentication with MySQL for a while, and was mistakenly under the impression that I'd need Mod Auth MySQL - not so, and its easy too.

Another tip - prefixing a php function with @ as in $db=3D@mysql_connect(parms) ) suppresses the normal PHP error messages. Then you can handle errors yourself. Could be useful and/or tidier.

The explanation of ``The Reload Problem'' (what happens when a user clicks on reload, and the effect of repeating SQL statements you've already run) was useful, and thought provoking. I had already come across issues where users (including myself) clicked multiple times on a form submission button, and had to deal with that.

PHP sessions are covered. Good job too; Very important and useful these days.

Rounding Up I think the authors didn't seem to know what level to aim for. It ranges from installation of software and creation of SSL certificates to entity relationship models and an explanation of tiered application architectures (and, shall I mention it again ? How the Internet works.) Much of the content is covered elsewhere more thoroughly (I'm thinking of several other O'Reilly titles - like ``MySQL and mSQL'', the imminent ``Programming PHP'' and obviously Apache: TDG.) If I were being more critical (over critical, maybe), I'd say that the authors had written the example application, exhausted the explanation of it, and were looking for a collection of other things with which to fill the book up.

I had hoped for more of a cookbook of techniques to use when developing further web applications ... (as I have just finished a php/mysql/apache implementation, and written some postnuke modules) ... but the emphasis has not been in this area. For instance some examples of the use of mysql_select_object, and when best to use mysql_fetch_array as opposed to mysql_fetch_row might have have been appropriate. Examples of processing SQL GROUP BY statements using php, different ways to count rows, and things of that ilk would have been good too.

The bottom line In summary, if you have the other O'Reilly titles mentioned above, keep away from the Platypus. I think the limited additional information you'll get won't be worth the shelf space (I'm having to relegate my Borland Turbo Pascal v5.0 Reference guide to accommodate this one) - and you already know how the Internet works, right ?

Conversely, I'm not convinced that there's enough information within this text to give the reader a full understanding of all the issues required to produce a web accessible database application. It covers a lot of ground (and, yes, it probably has to), but just spending a page or two on a subject is inadequate. (Database tuning is covered in three !) Its not my favourite O'Reilly book, as you may already appreciate (actually the MySQL one isn't great either), but its probably fine if you only want a quick overview of the plethora of topics covered.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
PO BOX 37
Buntingford
Herts
SG9 9UQ
More information

Page last modified 03 Apr 2007
Copyright © 1995-2011 UKUUG Ltd.