Book Review: Apress’ Beginning PHP and Oracle

4 June, 2008 (17:47) | PHP, UNIX

Recently I was offered the opportunity to review two PHP books from Apress, and from the list of options provided one that particularly struck my interest was the book Beginning PHP and Oracle: From Novice to Professional by W. Jason Gilmore and Bob Bryla. Read on for more..

Published in August 2007, Beginning PHP and Oracle: From Novice to Professional weighs in at a hefty 763 pages long. It’s one for the bookshelf, not for the backpack thats for sure! Immediate thoughts on the print and publishing quality are that they are both top-notch, the binding is great and should stand the test of time.

The book starts out with a great introduction to the PHP language, and it could easily be picked up by someone with a little programming knowledge quickly allowing them to get an introduction to the world of PHP development.

While I’m quite experienced with the PHP language itself, I was particularly interested in reviewing this title because I’ve only had limited experience and exposure to Oracle in the past and it is something I really wanted to add to my skills list.

In the list of enterprise-level skills you’ll learn from this book, you’ll find a chapter on the Zend Framework. This chapter discusses some of the alternatives such as Solar, Cake and Symfony before settling on the Zend Framework. While this is a short chapter, it explains the benefit of using a MVC framework and gives enough of an overview that a skilled coder will be able to take it and run with it, combined with the Oracle skills learned to create some excellent applications.

The book includes a chapter on SQLite which is a curious inclusion considering it’s heavy Oracle influence later in the book. I realise SQLite has uses where a larger database such as Oracle may be far from optimal, but by that logic so do MySQL and PostgreSQL.

The book has an excellent introduction to PDO, white it glosses over the fact it can connect to multiple databases such as MySQL, MSSQL, Postgres and others, it expectedly concentrates on using PDO to connect to an Oracle 10G XE server, as this is after all a core subject of the book. While this chapter is a good introduction to PDO, the remainder of the PHP code in the book uses the Oracle specific ora_*() functions. In this day and age, I would have expected the majority of code, at least after introducting PDO, to use PDO.

In chapter 26, the authors introduce the Oracle Database by discussing the various members of the Oracle family, Express Edition, Standard Edition, Standard Edition One, Enterprise Edition and Personal Edition. Express Edition (XE) receives the most coverage as it’s the version that’s concentrated on in this book.

So that I could obtain a good feel for the knowledge this book imparts on the reader, I installed a fresh copy of Windows 2003 Server in a VMWare Virtual Machine to allow me to run a copy of the Oracle 10G Express Edition database the book uses. Following the guides present in the book I was able to get Oracle downloaded (Oracle 10G XE is a free version of Oracle), installed and running on Windows 2003 Server with no issues. While Windows 2003 is not my choice of hosting platform, I chose to try Windows 2003 Server as I had a fresh copy running in a Virtual Machine for a separate (unrelated) Active Directory project.

I installed the Oracle Instant Client libraries on my Gentoo GNU/Linux workstation and rebuilt my local copy of PHP to support connection to a remote Oracle server, and following the code examples given in the book I was able to connect and manipulate the data stored in the remote Oracle server without referring to the online PHP manual.

My thoughts on the size of the book are mixed, I believe that there was enough ‘Oracle & PHP’ specific content to split that into its own book, but weather a book specifically about ‘Oracle & PHP’ without the introductory PHP chapters would sell enough on the market is a different story. The positive of including the introduction to PHP chapters is that someone suitably motivated could simply purchase this book and, because of the introduction to PHP and the included chapters on PEAR, Zend Framework, PDO and of course Oracle, quickly have access to a good portion of the knowledge needed to begin building enterprise-level PHP applications.

If you’re in the market for a book to perhaps learn PHP and would like to move onto advanced concepts later on, this book is worth a look. If you’re an experienced PHP developer and looking for an introduction into the world of Oracle, this is the book for you. Infact it’s hard to think of a category of reader this book may not suit, unless you’re in the absolute top echelon of developers, that is!

Comments

Comment from Boyan
Date: June 4, 2008, 6:23 pm

Well, the book is good for people who are to enter the world. It is not worthy, IMHO, for those that are aware with object orientation, advanced PHP and etc., but are just seeking for information for PHP and ORACLE basic and advancet concepts and integration. Just a little too large part of the book is dedicated to PHP, patterns and OOP.

Comment from Ulf
Date: June 4, 2008, 8:25 pm

Dig a bit deeper into PDO and you understand why one cannot recommend PDO as the all-mighty weapon. PDO needs a lot of love and I can only ask everybody to help improving PDO. There is a good number of issues rooted in the PDO core and every driver suffers from them.

Comment from vortex
Date: June 4, 2008, 10:40 pm

@Ulf
Im not sure what you’re reffering to, but in my last 18 months of PDO use I haven’t run into any issues that would make me choose to use mysql_*() or ora_*() over PDO itself.

Comment from John Wells
Date: July 22, 2008, 1:36 am

PDO is definitely the way to go.