BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?

Web Database Applications with PHP, and MySQL

By Hugh E. Williams, David Lane
March 2002
Pages: 582
ISBN 10: 0-596-00041-3 | ISBN 13: 9780596000417
starstarstarstarstar (Average of 10 Customer Reviews)

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

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 the 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 Wine Store, a complete (but fictional) online retail site implemented using PHP and MySQL.
Full Description

What do eBay, Amazon.com and CNN.com have in common? They're all applications that integrate large databases with the Web. The popularity (and power) of these applications stems from their accessibility and usability: thousands of users can access the same data at the same time without theneed to install any additional software on their computers. 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. If you want to build small to medium-scale web database applications that can run on modest hardware and process more than a million hits a day from users, this book will show you how.
Post-purchase benefits:

Register your book | Submit Errata | Authors' Site & Examples


Browse within this book

Cover | Table of Contents | Index | Sample Chapter | Colophon

Book details

First Edition: March 2002
ISBN: 0-596-00041-3
Pages: 582
Average Customer Reviews: starstarstarstarstar (Based on 10 Reviews)


Featured customer reviews

Write a Review


Web Database Applications with PHP & MySQL Review,  January 07 2003
Rating: StarStarStarStarStar
Submitted by Bruno Vansimpsen   [Respond | View]

I've read the book last summer without a mysql- or apache server near to me. But once returned at home this book gave my so many ideas that I was able to make my own multiple choice application for my students and to adapte an existing elearnplatform "claroline". Thanks. This is teaching by example!!!


Web Database Applications with PHP & MySQL Review,  November 29 2002
Rating: StarStarStarStarStar
Submitted by Mick James   [Respond | View]

The source code from the book can be downloaded from www.databasebook.com like it says in the book - whoops!


Web Database Applications with PHP & MySQL Review,  November 29 2002
Rating: StarStarStarStarStar
Submitted by Mick James   [Respond | View]

Just a few points. I've been programming for just over a year - MScIT conversion course. PHP is pretty straightforward to learn from this book though there does seem to be a bias towards Unix based systems. The book could be enhanced with a few more diagrams and screen shots.

The indexing is poor. e.g. There is no mention of the word "menu" or "dropdown menu". okay, I know that this is also called a "select list" There is no mention of "operands". There are many other terms with are conspicuous by their absence. Is this just a American /British English language issue or is there more to it - either way it is frustrating.

I do not seem to be able to locate any of the code online which would be very useful.

The comments by previous reviewers regarding code being incorrect comes as no surprise, and whilst I appreciate that it is character building, so is living in poverty, it doesn't necessary mean that it is ideal.

O'Reilly, take note... each time you send a book to print with mistakes in the code, you lose your good reputation and eventually customers. Sort it out.

Read all reviews


Web Database Applications with PHP & MySQL Review,  October 05 2002
Rating: StarStarStarStarStar
Submitted by Michael Macrone   [Respond | View]

I advise anyone interested in this book to wait for a 2nd edition, or at least for a printing that corrects its numerous cosmetic and serious errors.

As I e-mailed O'Reilly in more detail, I started keeping track of the mistakes on page 63 and by page 124 I'd found fourteen of them -- an error every 4 to 5 pages. The book is obviously very poorly edited, at least by O'Reilly's formerly unimpeachable standards.

Function names are spelled in different ways (for example, "asort" and "assort" on p. 63). Functions are defined incorrectly (for example, "strcmp" on page 71). Examples do not return the values the text says they will ($temp->showvalue() at the top of p. 103 returns 25, not 24). Figures are broken (Figure 3-3 on p. 115 is missing 85% of its labels).

A very disappointing showing.


Web Database Applications with PHP & MySQL Review,  September 27 2002
Rating: StarStarStarStarStar
Submitted by Michael Conway   [Respond | View]

This is to correct a mistake I made in some of my tips (09/23/03) on setting register_globals to OFF in php.ini 1)a). It isn't necessary and will disable the cart function. Sorry about that!


Web Database Applications with PHP & MySQL Review,  September 26 2002
Rating: StarStarStarStarStar
Submitted by Vicki Caton - Perth, Australia   [Respond | View]

Dear all,

I have just purchased this book and have found it a great source of knowledge and has helped me understand the "in's and out's" of database applications on the web using these technics.

Being new to PHP and MySQL it has given me a starting point to understand this technology and the authors, Hugh Williams and Dave Lane, have made it easy to follow.

Congratulations of a great book!!!

All the best...


Web Database Applications with PHP & MySQL Review,  September 23 2002
Rating: StarStarStarStarStar
Submitted by Michael Conway   [Respond | View]

As a newbie (PHP - version 4.0.4.pl1 and MySQL -version 3.23.26 on RedHat 7.1 are my introduction to both programming and RDBMS - so there is hope!), I have to say that this is the best book on the subject that I have read so far. I have successfully installed the code and used the examples including the winestore site. There are some issues which I hope to address as tips on using this book that may seem trivial or stupid to the initiated. Remember that these tips may be particular to the versions I am using.

1) Follow the instructions on sessions with care and pay attention to the details. For example, an earlier discussion notes the session.name PHPSESSID default ("there is no reason to change unless..." - p.324) in php.ini and then the examples for "Managing Sessions" (Appendix D p.535) requires changing this to PHPSESSION (you must add the table to your winestore db using the example p.528). Go ahead an back up the php.ini file before you alter it.

a) The "bear trap" tip on page 330 is NOT a suggestion. If you do not make certain that register_globals is "Off" in php.ini, you will not acheive the desired results when using the validation script to repopulate the member form after a mistake.

2) There are two db.inc files (the dbdummy.inc files), one for the book examples and one for the winestore application. The difference is that the "examples" version includes the "clean" function. If you altered and copied this "example" version to your /usr/share directory (Suggestion: Create a php directory under /usr/share and add the altered - according to instructions - db.inc file then open php.ini and go to include_path to add =".:/usr/share/php" [for Linux] as the comments suggest syntax - fyi this is where you should put error.inc and include.inc as well if you follow these directions) you need to get rid of the "clean" function when you move on to the winestore application (whose db.inc excludes the function) because it is already provided in include.inc. If you don't do this Browser will say: "Cannot redeclare clean()". If you are Tarzan (like me), this means "you have attempted to define the same function in the same way twice - BOING!"

3) I had problems with "require" on every script that used this (again - "Cannot redeclare ..."). Using require_once (for error.inc, include.inc) solved this problem for me on every script. I don't say it is the optimal solution - it just works (authors?).

4) For error.inc, go ahead and change the "hugh" under the "Send error to the administrator by email" comment to your user name so you can get hugh's hate mail from Apache(just one of those things).

5) The scripts have a few minor mistakes that you will have to debug with the help of your browser. (Sorry I didn't take notes, but it really helped in the learning experience - hey, it builds character!).

There is an issue (two depending upon how you look at it) that I will note. The use of addslashes and stripslashes becomes extremely important in dealing with sessions and the db ("clean" just doesn't cut it), especially if you alter the code and attempt to use special characters in the db. For example, if you put in a name like O'Connor in the member form, you will see the telltale slash in the membership acceptance and order forms, as well as the repopulation for change details on your browser. If you experiment and add a region name with a special character, all hell will break loose with sessions and the search function will not work for the region name (shopping cart - not at all). I am currently trying to solve this problem (help from authors or anybody appreciated).

Although Justin (obviously a mountain man compared to my flatlander experience) was a little harsh on the authors, I am very grateful. I would, however, like to see his comments addressed in the next edition.




Web Database Applications with PHP & MySQL Review,  June 13 2002
Rating: StarStarStarStarStar
Submitted by Justin Koivisto   [Respond | View]

I have not read this book. So why write a review? Well, read on to find out.

Like so many other PHP books out there, it is intended as a way of teaching a newbie how to program in PHP. This isn't a bad thing, however, when you teach a newbie how to do it poorly, that is another story. Just from reading the example chapter, I would not recommend this book (at least to a PHP newbie). The examples have mixed use of long and short tags. Short tags are not available on all servers.

The first code examples included assumes that register_globals = On (which is no longer the default for PHP-4.1.0 and newer. The author later warns that the best way to access GET, POST, and SESSSION variables is to use the HTTP_*_VARS arrays - which are replaced by new super global arrays ($_POST, $_GET, $_SESSION, etc.) in PHP-4.1 (current PHP version is 4.2.1)

These two points alone are the cause of many confused PHP newbies on USENET because they assume that an example in a book will work on all servers. However, for users that know PHP well enough to recognize these issues, the example chapter did do a good job of explaining the basic functionality of sessions along with when to use them, when not to use them, and examples of how to use them.


Web Database Applications with PHP & MySQL Review,  June 08 2002
Rating: StarStarStarStarStar
Submitted by Alex Kah   [Respond | View]

I recently took on the project of designing a ecommerce site with tens of thousands of products. I thought the project would be easy using third party software but after reviewing every shopping cart I could find I was not satisfied. I decided to build everything from the ground up so I could make it appear as I wanted it to and add any functionality with out running into red tape. This book was an excellent place to start. Thanks to the authors I am well on the way to creating a very successful ecommerce site. Thanks again.


Web Database Applications with PHP & MySQL Review,  May 17 2002
Rating: StarStarStarStarStar
Submitted by stuart graham   [Respond | View]

I've never written a review for a book I haven't read! I'm currently developing a large web site using PHP/MySQL and investigating using sessions for stateful control. The sample chapter here contains so much good, easy-to-digest information that I had to slow myself down whilst reading it! Now I will definently buy the book as the other chapters AREN'T free! I have already done some reading on the subject, but this book explains the method and its pitfalls in great detail.

As usual, O'Reilly scores well.


Media reviews

"Programming veterans will want more than this book offers (although they'll probably find themselves thinking 'Gee, I wish I'd had this when I began learning PHP'), but newbies will find 'Web Database Applications with PHP and MySQL' to be an excellent launch pad for their future endeavors. And veterans who are responsible for teaching PHP to their subordinates couldn't wish for a better instructional aid.''
--Anna Cahnda, AVN Online, October 2002.

"The authors' approach to teaching these tools was admirable. E-commerce is one of the most popular applications on the web and the development of such an engine employees a great many skills in terms of programming and database design. Important elements such as security, multiple users, managing inventory users, and multiple pricing thankfully received ample book time.''
--Paul Schneider, CompuNotes, Sept 2002

"Introduces techniques for building applications that integrate large databases with web interfaces. Using a three-tier architecture, the book focuses on the middle tier and the application logic that brings together the fundamentally different client and database tiers. The authors explain the principles behind searching, browsing, storing user data, validating user input, managing user transactions, and security."
--Booknews, July 2002

"'Web Database Applications with PHP & MySQL'...combines language tutorials with application design advice to yield a comprehensive picture of its subjects at a reasonable price. Williams and Lane--both Australian academics who use an online wine store in many of their examples--deserve tremendous kudos for their way of presenting recommended coding strategies.''
--David Wall, amazon.com, July 2002

"A first class reference and highly recommended instructional guide.''
--Wisconsin Bookwatch, June 2002.

"A useful book that offers a lot of varied information in one place for updating your skills.''
--Phil Hughes, Linux Journal, June 23 2002

"As an intermediate to advanced PHP/MySQL developer, this book introduced me to some new concepts that I had never considered before. I see this book to be most valuable, however, to the developer who is just beginning his path toward this excellent technology. A+."
--Dave Whitinger, lwn.net, June 2002.

"This book has all that you can expect in book about PHP and MySQL... If you are looking for a book that provides a good introduction and insight over the development of PHP and MySQL based applications, this may be a very good and up to date book on this subject."
--Manuel Lemos, PHPClasses Website, September 15, 2002

"If you need a quick start into the world of web applications, 'Web Database Applications with PHP & MySQL' is worth every penny."--Shelley Doll, Builder.com, Aug 26, 2002

"The book manages to deliver on two levels at once--the concepts, planning and design process as well as implementation. It's also surprisingly well written, and manages not to be too smug or patronizing."--Nick Veitch, LinuxFormat, October 2002

"O'Reilly books are often seen as the missing manuals and training courses for the open source world, and 'Web Database Applications with PHP and MySQL' is no exception to this rule.?
--Simon Bisson, Application Development Advisor, August 2002

"As symbolized by the duck-billed platypus on the cover it is a book that will help you to survive in a rapidly changing world. Submerge yourself in proven technology and emerge unscathed once the dots have fallen out by the wayside. Recommended for its excellent examples which will save you thousands in case you need to develop a similar application."
--Information Security Bulletin, July 2002

"A useful book that offers a lot of varied information in one place for updating your skills. This book is subtitled 'Building Effective Database-Driven Web Sites,' and I feel it is right on target. This is not a book for someone unfamiliar with programming, but if you have a programming background, the book will get you thinking about web design (system design, not graphic design), as well as PHP and MySQL programming. Additionally, if you have dabbled with PHP and/or MySQL and are now ready to update your system design skills and move onto a larger project, this is a good book to move you along...All in all, this is a very good book. I have lots of books on PHP and databases and have found myself looking in multiple books in order to synthesize an answer. In many cases I can see the complete answer in this one book. If you don't need computer concepts and language hand-holding but want to do a database-driven web application right, this book is well worth the price."
--Phil Hughes, Linux Journal, June 23, 2002

"'Web Database Applications' is tightly-focused, packing in lots of solid technical information without wasting words. It does not pretend to cover all the potential uses of PHP, and the screen shots will not win prizes for design, but it's a great handbook for building robust, secure database applications with these popular technologies."
--Tim Anderson, amazon.uk, May 2002

"A comprehensive, tutorial-style roadmap for building data-driven web applications with PHP and MySQL...the book manages to be comprehensive without patronizing the reader...For seasoned developers, this could be the book that you wish you'd had when you started out building web database apps and data-driven sites. Keeping a copy around for reference, especially if you frequently jump back and forth between projects in different languages/environments, might also be helpful for those occasions when you need of a quick refresher in PHP/MySQL dev. Moreover, if you find yourself in the position of having to mentor junior developers (or helping non-coder friends) building or maintaining PHP/MySQL-based sites or apps, then lending them your copy or recommending that they buy their own could save you quite a bit of time and frustration."
--Brian Donovan, slashdot.org, June 13, 2002

"Even though it's designed primarily for web developers who want to use PHP and MYSQL, those who want to learn how to develop web applications should find it a valuable resource for self-teaching. Everything about this book lives up to the reputation of O'Reilly publications: well written, well-presented, supported by a website, and of the highest typographical standard."
--Major Keary, Book News 2002 No 10

"A first class reference and highly recommended instructional guide."
--Wisconsin Bookwatch, June 2002

"The book provides a good grounding in PHP and MySQL from the theory of databases and the Web to the development of a practical example of a completed application. Advanced topics are introduced and clearly explained. All in all, it is a comprehensive guide to developing web applications using PHP and MySQL. Recommended for anyone who wishes to develop mid-sized database applications or who wishes to hone his or her PHP and MySQL skills. So, did I find the book useful? Yes, very useful. In addition, I gained a
better understanding of some of the underlying principles."
--Les Benson, Big Blue & Cousins Newsletter, June 2002

Hide extended reviews


See larger cover