Sams: The Welling and Thomson book is more "hands-on" in that it takes the reader step-by-step in developing an e-commerce website. The chapters are organized in a goal-oriented manner: PHP, MySQL, the basics of e-commerce, security, and design of the site.
If I had to choose just one book, I would go with the Sams book due to its more gentle learning curve. However, I believe that the O'Reilly book is no slouch, and I will probably come to appreciate it more once I gain more experience in PHP and MySQL development.
I highly recommend both books to prospective PHP and MySQL developers who are willing to spend some time and effort.
PHP is a powerful language that is open source and that can be used in lieu of Java and .NET technologies for many web applications that aren't too complex. For most small business owners, this should suffice. I am not too sure about using it in large corporations. This is one of the most popular open source technology along with Linux and MySQL.
MySQL is an open source database that can be used instead of SQL Server, Access, or Oracle. Once again, when the database application gets complex, I am not confident of its ability to handle the complexity. This is also excellent for small businesses but not large corporations.
There are about 13 chapters and 5 appendices spanning 550 pages starting with an introduction to database applications and the web, continuing with an intro to PHP and MySQL, covering the main concepts behind web technologies and ending with the sample wine store application. The main concepts discussed are querying databases, writing to databases, validations on the server and client, session management, user authentication and security. The appendices handle installation, modeling and designing relational databases, managing sessions in the database tier, etc.
Overall, the selection of topics is perfect for Intermediate programmers and the explanations are very detailed yet simple. This is probably one of the reasons this book is so popular. I have thoroughly enjoyed using this book and I am not surprised to see such a high quality book from this publisher. I am not familiar with the authors but I am going to keep an eye open in the future for other books by them.
I felt it was a bit pricey for a book of this nature but this is the only one I could find that covered these specific topics so I am not going to complain. Enjoy creating your own database driven website!