Nice but I actually prefer using PDO Connections because it takes less lines of codes and with can easily prevent SQL Injection. Also it is described on Codecourse YouTube Channel.
Object-Oriented MySQLi and PDO are both an equal amount of lines, PDO might even be one shorter. Most developers will use PDO, as it has way more options than MySQLi, which only supports the MySQL driver, as where PDO supports 12 databses. MySQLi does not support named parameters, which PDO does, as they contribute to code readability.A preference that isn't shared by other developers.
PDO does not 'take less lines of code' as you put it. In fact you would have to do more; there's nothing wrong with the MySQLi class.
Ah yes; thank you PDO for coming with all those unused drivers.Object-Oriented MySQLi and PDO are both an equal amount of lines, PDO might even be one shorter. Most developers will use PDO, as it has way more options than MySQLi, which only supports the MySQL driver, as where PDO supports 12 databses. MySQLi does not support named parameters, which PDO does, as they contribute to code readability.
Besides that, PDO is mainly the industry standard. MySQLi is just an easy drop-in to replace MySQL. Personally, I think MySQLi will be deprecated eventually too.
Unused to who?Ah yes; thank you PDO for coming with all those unused drivers.