Simplifying database interactions with Doctrine DBAL

I previously wrote about switching from the mysql extension to PDO. PDO introduces a number of convenient features beyond the mysql extension such as transactions, prepared statements, and more fetching options. However there are still a few things that are a bit painful. This article will introduce Doctrine DBAL to help alleviate some of these pain points. Doctrine DBAL is a wrapper around PDO. It adds a few conveniences beyond straight PDO as well as a query builder. There are a number of…
Read More →

Moving from mysql_query to PDO

The mysql extension has been marked as deprecated as of php 5.5.0 and will be removed completely in a future version. It is old and not very user friendly. This article will introduce PDO as a replacement. Connecting to a Database Connecting with mysql_connect The mysql_connect function returns a MySQL link identifier if the database connection was successful or FALSE if the connection was not successful. After connecting to the database server the database must be selected before any queries…
Read More →
Copyright © 2022 - Jonathan Bernardi