Summary and Perspectives
We’ve learned a lot throughout this course. Here are some key takeaways:
- To connect to the database in PHP, use the PDO extension like this:
$connection = new PDO($dsn, $username, $password, $options);
- To run a query, we either use the
PDO::querymethod if no variable is going to be used in the query or the
execute()functions if at least one variable is going to be used.
- It doesn’t really matter if we’re running our query with the
- MVC is an architectural pattern that is used to break up code into three logical components: model, view, and controller.
- We should never trust user-submitted data. We should always check for validation, both on the client-side and the server-side.
- Routing consists of mapping an HTTP request to a request handler, which can either be a function or a method.
We are grateful to you for learning with us. This course was only a small step towards the more advanced topics in PHP. There are still many things you may need to learn to feel more comfortable working with PHP.
But remember, grasping the concepts of programming takes time and practice. As they say, Rome wasn’t built in a day. Every professional developer that you know, or meet will have taken the same path.
Keep on practicing
We all know that practice makes perfect. So, if you want to become more confident as a PHP developer, practice your craft on a regular basis. In particular, we urge you to start building a personal project right now. This is the best way to stay focused and create something meaningful while having fun along the way. You may already have a project idea in the back of your mind. If not, here are a few ideas: