Book Review: Learning PHP Data Objects

Learning PHP Data Objects by Dennis Popel, pub­lished by Packt Publishing (© 2007) ISBN-13: 978–1847192660

Learning PHP Data Objects

Learning PHP Data Objects

This is a good start for PDO. The exam­ples and method­ol­o­gy used to present the con­cepts for using PDO were very use­ful. The book steps you from the basic use of PDO in chap­ter 2, through error han­dling and a good dis­cus­sion of pre­pared state­ments, on to the more advanced top­ics of PDO set­tings and trans­ac­tions.

I felt trans­ac­tions need­ed bet­ter treat­ment, includ­ing the fact that MySQL only does trans­ac­tions with cer­tain table types such an InnoDB. His exam­ples in this chap­ter do not show he is using a trans­ac­tion friend­ly table type for MySQL (sqlite is always). Nor does he explain why you would want to even use PDO trans­ac­tions when your table type is not trans­ac­tion friend­ly — it is implied that there is no ben­e­fit.

He fin­ish­es the dis­cus­sion in chap­ter 7 by mod­i­fy­ing his exam­ples to bet­ter fit the MVC par­a­digm. Personally, I feel he should have just start­ed with it instead of try­ing to mod­i­fy the code but that is my prej­u­dice. If he had, he might have had more room for those things he left out .

If this book had not been pub­lished by Packt, I would have been very dis­ap­point­ed in the con­tent vs price — $40 for 154 pages on the top­ic. Since Packt does con­tribute to open source projects based on the book’s sub­ject, I kind of for­give the cost.

However, the mul­ti­ple times the author says “out­side the scope of this book” kept remind­ing me that I paid $40 for such a short book. At least one time, I would have real­ly liked to see more dis­cus­sion regard­ing some­thing he said was out­side the scope, as if the book was already 900 pages long. I do give kudos to the author of at least hav­ing an appen­dix on OOP con­sid­er­ing PDO is all about OOP — although I would have much more pre­ferred to have also seen OOP tech­niques used through­out the code exam­ples instead of a minor com­ment.

One oth­er minor gripe I had, the use of short tags instead of through­out the code exam­ples. It drove me crazy since I can’t use them and real­ly wish I could (XML com­pat­i­bil­i­ty issues). And it also kept remind­ing me that the use of

Leave a Reply