In the previous chapters, we have looked at the basics of PDO, and you may have noticed that most of its functionality resembles the traditional extensions used to connect to databases. The only new thing is exceptions, but even that can be similar to traditional error handling.
In this chapter we will look at a new concept that was not present in PHP before PDO: prepared statements. We will see how they can further simplify our code and even lead to better performance. We will also look at how PDO works with BLOBs—all in a database-independent manner, of course.
Regarding our library management application, we will rewrite the edit/update functionality added in the previous chapter so as to facilitate prepared statements, as well as add support for book cover images, which we will keep in the database.