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­ogy 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 transactions.

I felt trans­ac­tions needed 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 friendly 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 friendly — it is implied that there is no benefit.

He fin­ishes 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 started with it instead of try­ing to mod­ify the code but that is my prej­u­dice. If he had, he might have had more room for those things he left out <rolls eyes>.

If this book had not been pub­lished by Packt, I would have been very dis­ap­pointed in the con­tent vs price — $40 for 154 pages on the topic. 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 really 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 comment.

One other minor gripe I had, the use of short tags <?= ?> instead of <?php echo ?> through­out the code exam­ples. It drove me crazy since I can’t use them and really wish I could (XML com­pat­i­bil­ity issues). And it also kept remind­ing me that the use of <?= is to save space and good grief, not like this book needed to save space. Anyone try­ing to use this code to learn will have to mod­ify it if their php set­tings have short_tags off.

Tagged with:
 

Leave a Reply

Looking for something?

Use the form below to search the site:


Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...