To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

BalfBlog now uses PDO

11 Mar 2017 at 11:03
PDO is finally here!

One of the biggest updates in terms of what it brings is the move from MySQLi to PDO - PHP's data objects for databases. Not only does PDO make it easier for me to add future database systems, it makes it easier for me to write the code.

MySQLi's biggest problem is the way in which prepared statements are formed:

$stmt -> bind_param("ss", $username, $password);

PDO solves this issue by making it possible for me generate any query and provide any number of parameters, thus allowing me to call the execute on the query at just one point. If you look through the new version BalfBlog you will understand why this is crucial.

Nothing will change on the front end, although the performance is much better with PDO because of the way it is written.