In this chapter, we examined how PDO
handles errors and introduced exceptions. Also, we investigated the sources of errors and saw how to counter them.
Our sample application was extended with some real-world administration functionality that uses data validation and is secured against SQL injection attacks. Of course, they should also allow database modifications only to certain users based on login names and passwords. However, this is beyond the scope of this book.
In the next chapter, we will look at another very important aspect of PDO and database programming in general—using prepared statements. We will see how our administration pages can be simplified with their help, leading to less code and better maintenance.